\doxysubsection{dgr-\/router-\/interface.cc}
\hypertarget{dgr-router-interface_8cc_source}{}\label{dgr-router-interface_8cc_source}\index{model/dgr-\/router-\/interface.cc@{model/dgr-\/router-\/interface.cc}}
\mbox{\hyperlink{dgr-router-interface_8cc}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00001}00001\ \textcolor{comment}{/*\ -\/*-\/\ Mode:C++;\ c-\/file-\/style:"{}gnu"{};\ indent-\/tabs-\/mode:nil;\ -\/*-\/\ */}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00002}00002\ \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00003}00003\ \textcolor{comment}{\ *\ Copyright\ 2007\ University\ of\ Washington}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00004}00004\ \textcolor{comment}{\ *\ }}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00005}00005\ \textcolor{comment}{\ *\ This\ program\ is\ free\ software;\ you\ can\ redistribute\ it\ and/or\ modify}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00006}00006\ \textcolor{comment}{\ *\ it\ under\ the\ terms\ of\ the\ GNU\ General\ Public\ License\ version\ 2\ as}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00007}00007\ \textcolor{comment}{\ *\ published\ by\ the\ Free\ Software\ Foundation;}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00008}00008\ \textcolor{comment}{\ *}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00009}00009\ \textcolor{comment}{\ *\ This\ program\ is\ distributed\ in\ the\ hope\ that\ it\ will\ be\ useful,}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00010}00010\ \textcolor{comment}{\ *\ but\ WITHOUT\ ANY\ WARRANTY;\ without\ even\ the\ implied\ warranty\ of}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00011}00011\ \textcolor{comment}{\ *\ MERCHANTABILITY\ or\ FITNESS\ FOR\ A\ PARTICULAR\ PURPOSE.\ \ See\ the}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00012}00012\ \textcolor{comment}{\ *\ GNU\ General\ Public\ License\ for\ more\ details.}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00013}00013\ \textcolor{comment}{\ *}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00014}00014\ \textcolor{comment}{\ *\ You\ should\ have\ received\ a\ copy\ of\ the\ GNU\ General\ Public\ License}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00015}00015\ \textcolor{comment}{\ *\ along\ with\ this\ program;\ if\ not,\ write\ to\ the\ Free\ Software}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00016}00016\ \textcolor{comment}{\ *\ Foundation,\ Inc.,\ 59\ Temple\ Place,\ Suite\ 330,\ Boston,\ MA\ \ 02111-\/1307\ \ USA}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00017}00017\ \textcolor{comment}{\ *}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00018}00018\ \textcolor{comment}{\ *\ Authors:\ \ Tom\ Henderson\ (tomhend@u.washington.edu)}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00019}00019\ \textcolor{comment}{\ */}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00020}00020\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00021}00021\ \textcolor{preprocessor}{\#include\ "{}ns3/log.h"{}}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00022}00022\ \textcolor{preprocessor}{\#include\ "{}ns3/assert.h"{}}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00023}00023\ \textcolor{preprocessor}{\#include\ "{}ns3/abort.h"{}}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00024}00024\ \textcolor{preprocessor}{\#include\ "{}ns3/channel.h"{}}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00025}00025\ \textcolor{preprocessor}{\#include\ "{}ns3/net-\/device.h"{}}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00026}00026\ \textcolor{preprocessor}{\#include\ "{}ns3/node.h"{}}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00027}00027\ \textcolor{preprocessor}{\#include\ "{}ns3/node-\/list.h"{}}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00028}00028\ \textcolor{preprocessor}{\#include\ "{}ns3/ipv4.h"{}}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00029}00029\ \textcolor{preprocessor}{\#include\ "{}ns3/bridge-\/net-\/device.h"{}}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00030}00030\ \textcolor{preprocessor}{\#include\ "{}\mbox{\hyperlink{ipv4-dgr-routing_8h}{ipv4-\/dgr-\/routing.h}}"{}}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00031}00031\ \textcolor{preprocessor}{\#include\ "{}\mbox{\hyperlink{dgr-router-interface_8h}{dgr-\/router-\/interface.h}}"{}}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00032}00032\ \textcolor{preprocessor}{\#include\ "{}ns3/loopback-\/net-\/device.h"{}}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00033}00033\ \textcolor{preprocessor}{\#include\ <vector>}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00034}00034\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00035}00035\ \textcolor{keyword}{namespace\ }\mbox{\hyperlink{namespacens3}{ns3}}\ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00036}00036\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00037}\mbox{\hyperlink{namespacens3_a9c46a7480869a9e2de9a96276969e9c1}{00037}}\ \mbox{\hyperlink{namespacens3_adde9ed23eff577cdfec10d85035e32eb}{NS\_LOG\_COMPONENT\_DEFINE}}\ (\textcolor{stringliteral}{"{}DGRRouter"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00038}00038\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00039}00039\ \textcolor{comment}{//\ -\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00040}00040\ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00041}00041\ \textcolor{comment}{//\ DGRRoutingLinkRecord\ Implementation}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00042}00042\ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00043}00043\ \textcolor{comment}{//\ -\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00044}00044\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00045}\mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_ac9084e29ac639975a3e265cdd618d2c2}{00045}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_ac9084e29ac639975a3e265cdd618d2c2}{DGRRoutingLinkRecord::DGRRoutingLinkRecord}}\ ()}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00046}00046\ \ \ :}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00047}00047\ \ \ \ \ m\_linkId\ (\textcolor{stringliteral}{"{}0.0.0.0"{}}),}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00048}00048\ \ \ \ \ m\_linkData\ (\textcolor{stringliteral}{"{}0.0.0.0"{}}),}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00049}00049\ \ \ \ \ m\_linkType\ (Unknown),}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00050}00050\ \ \ \ \ m\_metric\ (0)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00051}00051\ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00052}00052\ \ \ NS\_LOG\_FUNCTION\ (\textcolor{keyword}{this});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00053}00053\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00054}00054\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00055}\mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_aa2d023b51b9299b5e20fccd6e518c672}{00055}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_ac9084e29ac639975a3e265cdd618d2c2}{DGRRoutingLinkRecord::DGRRoutingLinkRecord}}\ (}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00056}00056\ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_a93b89b9f89407a39712186911ad12a4b}{LinkType}}\ \ \ \ linkType,\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00057}00057\ \ \ Ipv4Address\ linkId,\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00058}00058\ \ \ Ipv4Address\ linkData,\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00059}00059\ \ \ uint16\_t\ \ \ \ metric)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00060}00060\ \ \ :}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00061}00061\ \ \ \ \ m\_linkId\ (linkId),}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00062}00062\ \ \ \ \ m\_linkData\ (linkData),}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00063}00063\ \ \ \ \ m\_linkType\ (linkType),}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00064}00064\ \ \ \ \ m\_metric\ (metric)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00065}00065\ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00066}00066\ \ \ NS\_LOG\_FUNCTION\ (\textcolor{keyword}{this}\ <<\ linkType\ <<\ linkId\ <<\ linkData\ <<\ metric);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00067}00067\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00068}00068\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00069}\mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_ad42c3b86dbd2e8716653a004dafd515b}{00069}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_ad42c3b86dbd2e8716653a004dafd515b}{DGRRoutingLinkRecord::\string~DGRRoutingLinkRecord}}\ ()}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00070}00070\ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00071}00071\ \ \ NS\_LOG\_FUNCTION\ (\textcolor{keyword}{this});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00072}00072\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00073}00073\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00074}00074\ Ipv4Address}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00075}\mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_a9fe6e135674ef321bc11b48f90071857}{00075}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_a9fe6e135674ef321bc11b48f90071857}{DGRRoutingLinkRecord::GetLinkId}}\ (\textcolor{keywordtype}{void})\textcolor{keyword}{\ const}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00076}00076\ \textcolor{keyword}{}\{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00077}00077\ \ \ NS\_LOG\_FUNCTION\ (\textcolor{keyword}{this});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00078}00078\ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_a19605f0540a6904bd5801a7e1bd07895}{m\_linkId}};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00079}00079\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00080}00080\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00081}00081\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00082}\mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_a203541f10ca13f9cfb1987fbbff4416b}{00082}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_a203541f10ca13f9cfb1987fbbff4416b}{DGRRoutingLinkRecord::SetLinkId}}\ (Ipv4Address\ addr)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00083}00083\ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00084}00084\ \ \ NS\_LOG\_FUNCTION\ (\textcolor{keyword}{this}\ <<\ addr);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00085}00085\ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_a19605f0540a6904bd5801a7e1bd07895}{m\_linkId}}\ =\ addr;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00086}00086\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00087}00087\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00088}00088\ Ipv4Address}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00089}\mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_a97080a8409f77898f4485230be0be5e4}{00089}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_a97080a8409f77898f4485230be0be5e4}{DGRRoutingLinkRecord::GetLinkData}}\ (\textcolor{keywordtype}{void})\textcolor{keyword}{\ const}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00090}00090\ \textcolor{keyword}{}\{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00091}00091\ \ \ NS\_LOG\_FUNCTION\ (\textcolor{keyword}{this});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00092}00092\ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_a90859ad36a2936e26b9e933a323e35df}{m\_linkData}};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00093}00093\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00094}00094\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00095}00095\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00096}\mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_a06083e776955f21fe1fd4e4927cf0b24}{00096}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_a06083e776955f21fe1fd4e4927cf0b24}{DGRRoutingLinkRecord::SetLinkData}}\ (Ipv4Address\ addr)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00097}00097\ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00098}00098\ \ \ NS\_LOG\_FUNCTION\ (\textcolor{keyword}{this}\ <<\ addr);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00099}00099\ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_a90859ad36a2936e26b9e933a323e35df}{m\_linkData}}\ =\ addr;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00100}00100\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00101}00101\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00102}00102\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_a93b89b9f89407a39712186911ad12a4b}{DGRRoutingLinkRecord::LinkType}}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00103}\mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_ab9148eaf7a9d088a397e66164c1f30b9}{00103}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_ab9148eaf7a9d088a397e66164c1f30b9}{DGRRoutingLinkRecord::GetLinkType}}\ (\textcolor{keywordtype}{void})\textcolor{keyword}{\ const}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00104}00104\ \textcolor{keyword}{}\{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00105}00105\ \ \ NS\_LOG\_FUNCTION\ (\textcolor{keyword}{this});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00106}00106\ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_ae33ce84e5118670a92ec8253b4e35a6e}{m\_linkType}};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00107}00107\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00108}00108\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00109}00109\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00110}\mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_aacc16a8566cd389fd974cbeb8dde6ddd}{00110}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_aacc16a8566cd389fd974cbeb8dde6ddd}{DGRRoutingLinkRecord::SetLinkType}}\ (}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00111}00111\ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_a93b89b9f89407a39712186911ad12a4b}{DGRRoutingLinkRecord::LinkType}}\ linkType)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00112}00112\ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00113}00113\ \ \ NS\_LOG\_FUNCTION\ (\textcolor{keyword}{this}\ <<\ linkType);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00114}00114\ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_ae33ce84e5118670a92ec8253b4e35a6e}{m\_linkType}}\ =\ linkType;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00115}00115\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00116}00116\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00117}00117\ uint16\_t}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00118}\mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_af96cb9a05b3d95d14b6af29e058e3712}{00118}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_af96cb9a05b3d95d14b6af29e058e3712}{DGRRoutingLinkRecord::GetMetric}}\ (\textcolor{keywordtype}{void})\textcolor{keyword}{\ const}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00119}00119\ \textcolor{keyword}{}\{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00120}00120\ \ \ NS\_LOG\_FUNCTION\ (\textcolor{keyword}{this});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00121}00121\ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_ad36a9c3468f8ca6ef6335eff2dfca4fe}{m\_metric}};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00122}00122\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00123}00123\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00124}00124\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00125}\mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_ac6b9632b024b3799a25209f1392c1ab8}{00125}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_ac6b9632b024b3799a25209f1392c1ab8}{DGRRoutingLinkRecord::SetMetric}}\ (uint16\_t\ metric)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00126}00126\ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00127}00127\ \ \ NS\_LOG\_FUNCTION\ (\textcolor{keyword}{this}\ <<\ metric);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00128}00128\ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_ad36a9c3468f8ca6ef6335eff2dfca4fe}{m\_metric}}\ =\ metric;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00129}00129\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00130}00130\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00131}00131\ \textcolor{comment}{//\ -\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00132}00132\ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00133}00133\ \textcolor{comment}{//\ DGRRoutingLSA\ Implementation}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00134}00134\ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00135}00135\ \textcolor{comment}{//\ -\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00136}00136\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00137}\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a42a5782aad1a9ced94e817f8139bec4e}{00137}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a42a5782aad1a9ced94e817f8139bec4e}{DGRRoutingLSA::DGRRoutingLSA}}()}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00138}00138\ \ \ :\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00139}00139\ \ \ \ \ m\_lsType\ (\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a}{DGRRoutingLSA}}::Unknown),}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00140}00140\ \ \ \ \ m\_linkStateId\ (\textcolor{stringliteral}{"{}0.0.0.0"{}}),}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00141}00141\ \ \ \ \ m\_advertisingRtr\ (\textcolor{stringliteral}{"{}0.0.0.0"{}}),}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00142}00142\ \ \ \ \ m\_linkRecords\ (),}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00143}00143\ \ \ \ \ m\_networkLSANetworkMask\ (\textcolor{stringliteral}{"{}0.0.0.0"{}}),}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00144}00144\ \ \ \ \ m\_attachedRouters\ (),}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00145}00145\ \ \ \ \ m\_status\ (\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a}{DGRRoutingLSA}}::LSA\_SPF\_NOT\_EXPLORED),}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00146}00146\ \ \ \ \ m\_node\_id\ (0)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00147}00147\ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00148}00148\ \ \ NS\_LOG\_FUNCTION\ (\textcolor{keyword}{this});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00149}00149\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00150}00150\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00151}\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a2bae2bd5dc6e1fde3c31d39028307fa0}{00151}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a42a5782aad1a9ced94e817f8139bec4e}{DGRRoutingLSA::DGRRoutingLSA}}\ (}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00152}00152\ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a2d6cf227cde572e9c99d273a0e0fa5f7}{DGRRoutingLSA::SPFStatus}}\ status,}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00153}00153\ \ \ Ipv4Address\ linkStateId,\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00154}00154\ \ \ Ipv4Address\ advertisingRtr)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00155}00155\ \ \ :}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00156}00156\ \ \ \ \ m\_lsType\ (\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a}{DGRRoutingLSA}}::Unknown),}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00157}00157\ \ \ \ \ m\_linkStateId\ (linkStateId),}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00158}00158\ \ \ \ \ m\_advertisingRtr\ (advertisingRtr),}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00159}00159\ \ \ \ \ m\_linkRecords\ (),}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00160}00160\ \ \ \ \ m\_networkLSANetworkMask\ (\textcolor{stringliteral}{"{}0.0.0.0"{}}),}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00161}00161\ \ \ \ \ m\_attachedRouters\ (),}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00162}00162\ \ \ \ \ m\_status\ (status),}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00163}00163\ \ \ \ \ m\_node\_id\ (0)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00164}00164\ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00165}00165\ \ \ NS\_LOG\_FUNCTION\ (\textcolor{keyword}{this}\ <<\ status\ <<\ linkStateId\ <<\ advertisingRtr);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00166}00166\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00167}00167\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00168}\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a042cca1bebf1189a3e40f0c3abcd5937}{00168}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a42a5782aad1a9ced94e817f8139bec4e}{DGRRoutingLSA::DGRRoutingLSA}}\ (\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a}{DGRRoutingLSA}}\&\ lsa)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00169}00169\ \ \ :\ m\_lsType\ (lsa.m\_lsType),\ m\_linkStateId\ (lsa.m\_linkStateId),}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00170}00170\ \ \ \ \ m\_advertisingRtr\ (lsa.m\_advertisingRtr),}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00171}00171\ \ \ \ \ m\_networkLSANetworkMask\ (lsa.m\_networkLSANetworkMask),}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00172}00172\ \ \ \ \ m\_status\ (lsa.m\_status),}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00173}00173\ \ \ \ \ m\_node\_id\ (lsa.m\_node\_id)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00174}00174\ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00175}00175\ \ \ NS\_LOG\_FUNCTION\ (\textcolor{keyword}{this}\ <<\ \&lsa);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00176}00176\ \ \ NS\_ASSERT\_MSG\ (\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a658f443f5c9022b0e979b70076dd3b16}{IsEmpty}}\ (),}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00177}00177\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}DGRRoutingLSA::DGRRoutingLSA\ ():\ Non-\/empty\ LSA\ in\ constructor"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00178}00178\ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a206ff392d0561c4b244a8c6fe8d824ab}{CopyLinkRecords}}\ (lsa);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00179}00179\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00180}00180\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00181}00181\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a}{DGRRoutingLSA}}\&}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00182}\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_af09c521adba74e1538773cebf14b3929}{00182}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_af09c521adba74e1538773cebf14b3929}{DGRRoutingLSA::operator=\ }}(\textcolor{keyword}{const}\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a}{DGRRoutingLSA}}\&\ lsa)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00183}00183\ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00184}00184\ \ \ NS\_LOG\_FUNCTION\ (\textcolor{keyword}{this}\ <<\ \&lsa);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00185}00185\ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_ae6c045e56d285913bdc92870f0e0ce45}{m\_lsType}}\ =\ lsa.\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_ae6c045e56d285913bdc92870f0e0ce45}{m\_lsType}};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00186}00186\ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a7934180d82eeada95c7c0918438f8f54}{m\_linkStateId}}\ =\ lsa.\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a7934180d82eeada95c7c0918438f8f54}{m\_linkStateId}};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00187}00187\ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_ae081e96bb7f72467f7bc7d3b6cab2548}{m\_advertisingRtr}}\ =\ lsa.\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_ae081e96bb7f72467f7bc7d3b6cab2548}{m\_advertisingRtr}};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00188}00188\ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a96b6a315aabd6e6067d627a47f755d39}{m\_networkLSANetworkMask}}\ =\ lsa.\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a96b6a315aabd6e6067d627a47f755d39}{m\_networkLSANetworkMask}},\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00189}00189\ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a81565148817b697f3aa67ee29aec1c34}{m\_status}}\ =\ lsa.\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a81565148817b697f3aa67ee29aec1c34}{m\_status}};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00190}00190\ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_afbc01e04115a275765d9336f3e388fc8}{m\_node\_id}}\ =\ lsa.\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_afbc01e04115a275765d9336f3e388fc8}{m\_node\_id}};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00191}00191\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00192}00192\ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_add7dc495e6a10547b0045aab19ea9bcc}{ClearLinkRecords}}\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00193}00193\ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a206ff392d0561c4b244a8c6fe8d824ab}{CopyLinkRecords}}\ (lsa);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00194}00194\ \ \ \textcolor{keywordflow}{return}\ *\textcolor{keyword}{this};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00195}00195\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00196}00196\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00197}00197\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00198}\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a206ff392d0561c4b244a8c6fe8d824ab}{00198}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a206ff392d0561c4b244a8c6fe8d824ab}{DGRRoutingLSA::CopyLinkRecords}}\ (\textcolor{keyword}{const}\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a}{DGRRoutingLSA}}\&\ lsa)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00199}00199\ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00200}00200\ \ \ NS\_LOG\_FUNCTION\ (\textcolor{keyword}{this}\ <<\ \&lsa);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00201}00201\ \ \ \textcolor{keywordflow}{for}\ (ListOfLinkRecords\_t::const\_iterator\ \mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}}\ =\ lsa.\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a05d8ade21d0728b6a2de9e3d3bd4f154}{m\_linkRecords}}.begin\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00202}00202\ \ \ \ \ \ \ \ \mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}}\ !=\ lsa.\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a05d8ade21d0728b6a2de9e3d3bd4f154}{m\_linkRecords}}.end\ ();\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00203}00203\ \ \ \ \ \ \ \ \mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}}++)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00204}00204\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00205}00205\ \ \ \ \ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record}{DGRRoutingLinkRecord}}\ *pSrc\ =\ *\mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00206}00206\ \ \ \ \ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record}{DGRRoutingLinkRecord}}\ *pDst\ =\ \textcolor{keyword}{new}\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record}{DGRRoutingLinkRecord}};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00207}00207\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00208}00208\ \ \ \ \ \ \ pDst-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_aacc16a8566cd389fd974cbeb8dde6ddd}{SetLinkType}}\ (pSrc-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_ab9148eaf7a9d088a397e66164c1f30b9}{GetLinkType}}\ ());}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00209}00209\ \ \ \ \ \ \ pDst-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_a203541f10ca13f9cfb1987fbbff4416b}{SetLinkId}}\ (pSrc-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_a9fe6e135674ef321bc11b48f90071857}{GetLinkId}}\ ());}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00210}00210\ \ \ \ \ \ \ pDst-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_a06083e776955f21fe1fd4e4927cf0b24}{SetLinkData}}\ (pSrc-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_a97080a8409f77898f4485230be0be5e4}{GetLinkData}}\ ());}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00211}00211\ \ \ \ \ \ \ pDst-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_ac6b9632b024b3799a25209f1392c1ab8}{SetMetric}}\ (pSrc-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_af96cb9a05b3d95d14b6af29e058e3712}{GetMetric}}\ ());}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00212}00212\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00213}00213\ \ \ \ \ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a05d8ade21d0728b6a2de9e3d3bd4f154}{m\_linkRecords}}.push\_back\ (pDst);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00214}00214\ \ \ \ \ \ \ pDst\ =\ 0;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00215}00215\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00216}00216\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00217}00217\ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a41531661fa28a374064823c36171ae0b}{m\_attachedRouters}}\ =\ lsa.\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a41531661fa28a374064823c36171ae0b}{m\_attachedRouters}};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00218}00218\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00219}00219\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00220}\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a20b74180087d2bace3c3196dd112bb9f}{00220}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a20b74180087d2bace3c3196dd112bb9f}{DGRRoutingLSA::\string~DGRRoutingLSA}}()}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00221}00221\ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00222}00222\ \ \ NS\_LOG\_FUNCTION\ (\textcolor{keyword}{this});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00223}00223\ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_add7dc495e6a10547b0045aab19ea9bcc}{ClearLinkRecords}}\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00224}00224\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00225}00225\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00226}00226\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00227}\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_add7dc495e6a10547b0045aab19ea9bcc}{00227}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_add7dc495e6a10547b0045aab19ea9bcc}{DGRRoutingLSA::ClearLinkRecords}}\ (\textcolor{keywordtype}{void})}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00228}00228\ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00229}00229\ \ \ NS\_LOG\_FUNCTION\ (\textcolor{keyword}{this});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00230}00230\ \ \ \textcolor{keywordflow}{for}\ (\ ListOfLinkRecords\_t::iterator\ \mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}}\ =\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a05d8ade21d0728b6a2de9e3d3bd4f154}{m\_linkRecords}}.begin\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00231}00231\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}}\ !=\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a05d8ade21d0728b6a2de9e3d3bd4f154}{m\_linkRecords}}.end\ ();\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00232}00232\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}}++)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00233}00233\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00234}00234\ \ \ \ \ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}Free\ link\ record"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00235}00235\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00236}00236\ \ \ \ \ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record}{DGRRoutingLinkRecord}}\ *p\ =\ *\mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00237}00237\ \ \ \ \ \ \ \textcolor{keyword}{delete}\ p;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00238}00238\ \ \ \ \ \ \ p\ =\ 0;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00239}00239\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00240}00240\ \ \ \ \ \ \ *\mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}}\ =\ 0;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00241}00241\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00242}00242\ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}Clear\ list"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00243}00243\ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a05d8ade21d0728b6a2de9e3d3bd4f154}{m\_linkRecords}}.clear\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00244}00244\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00245}00245\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00246}00246\ uint32\_t}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00247}\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a4b21b880eb8b7b733039d0dfaa8b48a4}{00247}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a4b21b880eb8b7b733039d0dfaa8b48a4}{DGRRoutingLSA::AddLinkRecord}}\ (\mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record}{DGRRoutingLinkRecord}}*\ lr)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00248}00248\ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00249}00249\ \ \ NS\_LOG\_FUNCTION\ (\textcolor{keyword}{this}\ <<\ lr);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00250}00250\ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a05d8ade21d0728b6a2de9e3d3bd4f154}{m\_linkRecords}}.push\_back\ (lr);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00251}00251\ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a05d8ade21d0728b6a2de9e3d3bd4f154}{m\_linkRecords}}.size\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00252}00252\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00253}00253\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00254}00254\ uint32\_t}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00255}\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a882a042d18bcbdea3bc1a3eb55dcfe58}{00255}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a882a042d18bcbdea3bc1a3eb55dcfe58}{DGRRoutingLSA::GetNLinkRecords}}\ (\textcolor{keywordtype}{void})\textcolor{keyword}{\ const}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00256}00256\ \textcolor{keyword}{}\{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00257}00257\ \ \ NS\_LOG\_FUNCTION\ (\textcolor{keyword}{this});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00258}00258\ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a05d8ade21d0728b6a2de9e3d3bd4f154}{m\_linkRecords}}.size\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00259}00259\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00260}00260\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00261}00261\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record}{DGRRoutingLinkRecord}}\ *}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00262}\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_acb5df9fec863df510911aa3e64d4aa04}{00262}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_acb5df9fec863df510911aa3e64d4aa04}{DGRRoutingLSA::GetLinkRecord}}\ (uint32\_t\ n)\textcolor{keyword}{\ const}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00263}00263\ \textcolor{keyword}{}\{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00264}00264\ \ \ NS\_LOG\_FUNCTION\ (\textcolor{keyword}{this}\ <<\ n);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00265}00265\ \ \ uint32\_t\ j\ =\ 0;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00266}00266\ \ \ \textcolor{keywordflow}{for}\ (\ ListOfLinkRecords\_t::const\_iterator\ \mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}}\ =\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a05d8ade21d0728b6a2de9e3d3bd4f154}{m\_linkRecords}}.begin\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00267}00267\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}}\ !=\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a05d8ade21d0728b6a2de9e3d3bd4f154}{m\_linkRecords}}.end\ ();\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00268}00268\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}}++,\ j++)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00269}00269\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00270}00270\ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (j\ ==\ n)\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00271}00271\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00272}00272\ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ *\mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00273}00273\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00274}00274\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00275}00275\ \ \ NS\_ASSERT\_MSG\ (\textcolor{keyword}{false},\ \textcolor{stringliteral}{"{}DGRRoutingLSA::GetLinkRecord\ ():\ invalid\ index"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00276}00276\ \ \ \textcolor{keywordflow}{return}\ 0;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00277}00277\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00278}00278\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00279}00279\ \textcolor{keywordtype}{bool}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00280}\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a658f443f5c9022b0e979b70076dd3b16}{00280}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a658f443f5c9022b0e979b70076dd3b16}{DGRRoutingLSA::IsEmpty}}\ (\textcolor{keywordtype}{void})\textcolor{keyword}{\ const}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00281}00281\ \textcolor{keyword}{}\{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00282}00282\ \ \ NS\_LOG\_FUNCTION\ (\textcolor{keyword}{this});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00283}00283\ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a05d8ade21d0728b6a2de9e3d3bd4f154}{m\_linkRecords}}.size\ ()\ ==\ 0;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00284}00284\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00285}00285\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00286}00286\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a38d676a01a677ff003f198d454cf0694}{DGRRoutingLSA::LSType}}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00287}\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_aa00b07a4d8639539e94817f98905ef19}{00287}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_aa00b07a4d8639539e94817f98905ef19}{DGRRoutingLSA::GetLSType}}\ (\textcolor{keywordtype}{void})\textcolor{keyword}{\ const}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00288}00288\ \textcolor{keyword}{}\{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00289}00289\ \ \ NS\_LOG\_FUNCTION\ (\textcolor{keyword}{this});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00290}00290\ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_ae6c045e56d285913bdc92870f0e0ce45}{m\_lsType}};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00291}00291\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00292}00292\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00293}00293\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00294}\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a898720f0e7c926c4ecd2ca89d09363dd}{00294}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a898720f0e7c926c4ecd2ca89d09363dd}{DGRRoutingLSA::SetLSType}}\ (\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a38d676a01a677ff003f198d454cf0694}{DGRRoutingLSA::LSType}}\ typ)\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00295}00295\ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00296}00296\ \ \ NS\_LOG\_FUNCTION\ (\textcolor{keyword}{this}\ <<\ typ);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00297}00297\ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_ae6c045e56d285913bdc92870f0e0ce45}{m\_lsType}}\ =\ typ;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00298}00298\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00299}00299\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00300}00300\ Ipv4Address}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00301}\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a0ec746b926044a548e4f3a09309322ce}{00301}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a0ec746b926044a548e4f3a09309322ce}{DGRRoutingLSA::GetLinkStateId}}\ (\textcolor{keywordtype}{void})\textcolor{keyword}{\ const}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00302}00302\ \textcolor{keyword}{}\{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00303}00303\ \ \ NS\_LOG\_FUNCTION\ (\textcolor{keyword}{this});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00304}00304\ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a7934180d82eeada95c7c0918438f8f54}{m\_linkStateId}};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00305}00305\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00306}00306\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00307}00307\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00308}\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a382594771f20561edde6e6b53d3bd982}{00308}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a382594771f20561edde6e6b53d3bd982}{DGRRoutingLSA::SetLinkStateId}}\ (Ipv4Address\ addr)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00309}00309\ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00310}00310\ \ \ NS\_LOG\_FUNCTION\ (\textcolor{keyword}{this}\ <<\ addr);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00311}00311\ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a7934180d82eeada95c7c0918438f8f54}{m\_linkStateId}}\ =\ addr;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00312}00312\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00313}00313\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00314}00314\ Ipv4Address}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00315}\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_aa16092b325a84e50b90fcc5dd4e5bab2}{00315}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_aa16092b325a84e50b90fcc5dd4e5bab2}{DGRRoutingLSA::GetAdvertisingRouter}}\ (\textcolor{keywordtype}{void})\textcolor{keyword}{\ const}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00316}00316\ \textcolor{keyword}{}\{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00317}00317\ \ \ NS\_LOG\_FUNCTION\ (\textcolor{keyword}{this});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00318}00318\ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_ae081e96bb7f72467f7bc7d3b6cab2548}{m\_advertisingRtr}};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00319}00319\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00320}00320\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00321}00321\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00322}\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a5f36eb9409d5d6532b9bd267e8d90f61}{00322}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a5f36eb9409d5d6532b9bd267e8d90f61}{DGRRoutingLSA::SetAdvertisingRouter}}\ (Ipv4Address\ addr)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00323}00323\ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00324}00324\ \ \ NS\_LOG\_FUNCTION\ (\textcolor{keyword}{this}\ <<\ addr);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00325}00325\ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_ae081e96bb7f72467f7bc7d3b6cab2548}{m\_advertisingRtr}}\ =\ addr;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00326}00326\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00327}00327\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00328}00328\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00329}\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a1d60ee05ffc0dd4d434fb12917f6c83e}{00329}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a1d60ee05ffc0dd4d434fb12917f6c83e}{DGRRoutingLSA::SetNetworkLSANetworkMask}}\ (Ipv4Mask\ mask)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00330}00330\ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00331}00331\ \ \ NS\_LOG\_FUNCTION\ (\textcolor{keyword}{this}\ <<\ mask);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00332}00332\ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a96b6a315aabd6e6067d627a47f755d39}{m\_networkLSANetworkMask}}\ =\ mask;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00333}00333\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00334}00334\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00335}00335\ Ipv4Mask}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00336}\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a3e3b9552f26b930f47dd069eaf0f3950}{00336}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a3e3b9552f26b930f47dd069eaf0f3950}{DGRRoutingLSA::GetNetworkLSANetworkMask}}\ (\textcolor{keywordtype}{void})\textcolor{keyword}{\ const}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00337}00337\ \textcolor{keyword}{}\{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00338}00338\ \ \ NS\_LOG\_FUNCTION\ (\textcolor{keyword}{this});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00339}00339\ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a96b6a315aabd6e6067d627a47f755d39}{m\_networkLSANetworkMask}};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00340}00340\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00341}00341\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00342}00342\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a2d6cf227cde572e9c99d273a0e0fa5f7}{DGRRoutingLSA::SPFStatus}}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00343}\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_afd80a2583858e08b8b3877a5401bf072}{00343}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_afd80a2583858e08b8b3877a5401bf072}{DGRRoutingLSA::GetStatus}}\ (\textcolor{keywordtype}{void})\textcolor{keyword}{\ const}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00344}00344\ \textcolor{keyword}{}\{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00345}00345\ \ \ NS\_LOG\_FUNCTION\ (\textcolor{keyword}{this});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00346}00346\ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a81565148817b697f3aa67ee29aec1c34}{m\_status}};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00347}00347\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00348}00348\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00349}00349\ uint32\_t}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00350}\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a945e5e3081dc4463d6335cf40d81b192}{00350}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a945e5e3081dc4463d6335cf40d81b192}{DGRRoutingLSA::AddAttachedRouter}}\ (Ipv4Address\ addr)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00351}00351\ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00352}00352\ \ \ NS\_LOG\_FUNCTION\ (\textcolor{keyword}{this}\ <<\ addr);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00353}00353\ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a41531661fa28a374064823c36171ae0b}{m\_attachedRouters}}.push\_back\ (addr);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00354}00354\ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a41531661fa28a374064823c36171ae0b}{m\_attachedRouters}}.size\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00355}00355\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00356}00356\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00357}00357\ uint32\_t}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00358}\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_ae7e796f5d4860d2236bef31d74364c91}{00358}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_ae7e796f5d4860d2236bef31d74364c91}{DGRRoutingLSA::GetNAttachedRouters}}\ (\textcolor{keywordtype}{void})\textcolor{keyword}{\ const}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00359}00359\ \textcolor{keyword}{}\{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00360}00360\ \ \ NS\_LOG\_FUNCTION\ (\textcolor{keyword}{this});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00361}00361\ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a41531661fa28a374064823c36171ae0b}{m\_attachedRouters}}.size\ ();\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00362}00362\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00363}00363\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00364}00364\ Ipv4Address}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00365}\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a1b5e5fa81d0506983a0755787a8d2d62}{00365}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a1b5e5fa81d0506983a0755787a8d2d62}{DGRRoutingLSA::GetAttachedRouter}}\ (uint32\_t\ n)\textcolor{keyword}{\ const}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00366}00366\ \textcolor{keyword}{}\{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00367}00367\ \ \ NS\_LOG\_FUNCTION\ (\textcolor{keyword}{this}\ <<\ n);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00368}00368\ \ \ uint32\_t\ j\ =\ 0;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00369}00369\ \ \ \textcolor{keywordflow}{for}\ (\ ListOfAttachedRouters\_t::const\_iterator\ \mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}}\ =\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a41531661fa28a374064823c36171ae0b}{m\_attachedRouters}}.begin\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00370}00370\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}}\ !=\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a41531661fa28a374064823c36171ae0b}{m\_attachedRouters}}.end\ ();\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00371}00371\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}}++,\ j++)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00372}00372\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00373}00373\ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (j\ ==\ n)\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00374}00374\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00375}00375\ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ *\mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00376}00376\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00377}00377\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00378}00378\ \ \ NS\_ASSERT\_MSG\ (\textcolor{keyword}{false},\ \textcolor{stringliteral}{"{}DGRRoutingLSA::GetAttachedRouter\ ():\ invalid\ index"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00379}00379\ \ \ \textcolor{keywordflow}{return}\ Ipv4Address\ (\textcolor{stringliteral}{"{}0.0.0.0"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00380}00380\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00381}00381\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00382}00382\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00383}\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a497453d1271c0020968487ec8ead99c5}{00383}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a497453d1271c0020968487ec8ead99c5}{DGRRoutingLSA::SetStatus}}\ (\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a2d6cf227cde572e9c99d273a0e0fa5f7}{DGRRoutingLSA::SPFStatus}}\ status)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00384}00384\ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00385}00385\ \ \ NS\_LOG\_FUNCTION\ (\textcolor{keyword}{this}\ <<\ status);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00386}00386\ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a81565148817b697f3aa67ee29aec1c34}{m\_status}}\ =\ status;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00387}00387\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00388}00388\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00389}00389\ Ptr<Node>}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00390}\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a5000c59488a04e9b809574c93624d3ce}{00390}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a5000c59488a04e9b809574c93624d3ce}{DGRRoutingLSA::GetNode}}\ (\textcolor{keywordtype}{void})\textcolor{keyword}{\ const}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00391}00391\ \textcolor{keyword}{}\{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00392}00392\ \ \ NS\_LOG\_FUNCTION\ (\textcolor{keyword}{this});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00393}00393\ \ \ \textcolor{keywordflow}{return}\ NodeList::GetNode\ (\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_afbc01e04115a275765d9336f3e388fc8}{m\_node\_id}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00394}00394\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00395}00395\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00396}00396\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00397}\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a5fb6e248545fbd3d50b34429e4780746}{00397}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a5fb6e248545fbd3d50b34429e4780746}{DGRRoutingLSA::SetNode}}\ (Ptr<Node>\ node)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00398}00398\ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00399}00399\ \ \ NS\_LOG\_FUNCTION\ (\textcolor{keyword}{this}\ <<\ node);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00400}00400\ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_afbc01e04115a275765d9336f3e388fc8}{m\_node\_id}}\ =\ node-\/>GetId\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00401}00401\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00402}00402\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00403}00403\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00404}\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a46f99ef0058670ce83157f4ab482aaee}{00404}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a46f99ef0058670ce83157f4ab482aaee}{DGRRoutingLSA::Print}}\ (std::ostream\ \&os)\textcolor{keyword}{\ const}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00405}00405\ \textcolor{keyword}{}\{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00406}00406\ \ \ NS\_LOG\_FUNCTION\ (\textcolor{keyword}{this}\ <<\ \&os);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00407}00407\ \ \ os\ <<\ std::endl;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00408}00408\ \ \ os\ <<\ \textcolor{stringliteral}{"{}==========\ DGR\ Routing\ LSA\ =========="{}}\ <<\ std::endl;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00409}00409\ \ \ os\ <<\ \textcolor{stringliteral}{"{}m\_lsType\ =\ "{}}\ <<\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_ae6c045e56d285913bdc92870f0e0ce45}{m\_lsType}};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00410}00410\ \ \ \textcolor{keywordflow}{if}\ (\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_ae6c045e56d285913bdc92870f0e0ce45}{m\_lsType}}\ ==\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a38d676a01a677ff003f198d454cf0694a0322ce07c2b94cdb14163bbe04cb9674}{DGRRoutingLSA::RouterLSA}})\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00411}00411\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00412}00412\ \ \ \ \ \ \ os\ <<\ \textcolor{stringliteral}{"{}\ (DGRRoutingLSA::RouterLSA)"{}};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00413}00413\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00414}00414\ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_ae6c045e56d285913bdc92870f0e0ce45}{m\_lsType}}\ ==\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a38d676a01a677ff003f198d454cf0694a5d51f5653b9ddf1d8bf640932068cb85}{DGRRoutingLSA::NetworkLSA}})\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00415}00415\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00416}00416\ \ \ \ \ \ \ os\ <<\ \textcolor{stringliteral}{"{}\ (DGRRoutingLSA::NetworkLSA)"{}};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00417}00417\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00418}00418\ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_ae6c045e56d285913bdc92870f0e0ce45}{m\_lsType}}\ ==\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a38d676a01a677ff003f198d454cf0694aca69c3cdc30b0ddcb8dd1dd95f79065a}{DGRRoutingLSA::ASExternalLSAs}})}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00419}00419\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00420}00420\ \ \ \ \ \ \ os\ <<\ \textcolor{stringliteral}{"{}\ (DGRRoutingLSA::ASExternalLSA)"{}};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00421}00421\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00422}00422\ \ \ \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00423}00423\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00424}00424\ \ \ \ \ \ \ os\ <<\ \textcolor{stringliteral}{"{}(Unknown\ LSType)"{}};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00425}00425\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00426}00426\ \ \ os\ <<\ std::endl;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00427}00427\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00428}00428\ \ \ os\ <<\ \textcolor{stringliteral}{"{}m\_linkStateId\ =\ "{}}\ <<\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a7934180d82eeada95c7c0918438f8f54}{m\_linkStateId}}\ <<\ \textcolor{stringliteral}{"{}\ (Router\ ID)"{}}\ <<\ std::endl;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00429}00429\ \ \ os\ <<\ \textcolor{stringliteral}{"{}m\_advertisingRtr\ =\ "{}}\ <<\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_ae081e96bb7f72467f7bc7d3b6cab2548}{m\_advertisingRtr}}\ <<\ \textcolor{stringliteral}{"{}\ (Router\ ID)"{}}\ <<\ std::endl;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00430}00430\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00431}00431\ \ \ \textcolor{keywordflow}{if}\ (\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_ae6c045e56d285913bdc92870f0e0ce45}{m\_lsType}}\ ==\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a38d676a01a677ff003f198d454cf0694a0322ce07c2b94cdb14163bbe04cb9674}{DGRRoutingLSA::RouterLSA}})\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00432}00432\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00433}00433\ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\ ListOfLinkRecords\_t::const\_iterator\ \mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}}\ =\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a05d8ade21d0728b6a2de9e3d3bd4f154}{m\_linkRecords}}.begin\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00434}00434\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}}\ !=\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a05d8ade21d0728b6a2de9e3d3bd4f154}{m\_linkRecords}}.end\ ();\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00435}00435\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}}++)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00436}00436\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00437}00437\ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record}{DGRRoutingLinkRecord}}\ *p\ =\ *\mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00438}00438\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00439}00439\ \ \ \ \ \ \ \ \ \ \ os\ <<\ \textcolor{stringliteral}{"{}-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/\ RouterLSA\ Link\ Record\ -\/-\/-\/-\/-\/-\/-\/-\/-\/-\/"{}}\ <<\ std::endl;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00440}00440\ \ \ \ \ \ \ \ \ \ \ os\ <<\ \textcolor{stringliteral}{"{}m\_linkType\ =\ "{}}\ <<\ p-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_ae33ce84e5118670a92ec8253b4e35a6e}{m\_linkType}};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00441}00441\ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (p-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_ae33ce84e5118670a92ec8253b4e35a6e}{m\_linkType}}\ ==\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_a93b89b9f89407a39712186911ad12a4bac9c0a2d3da9eb9fdafee93e52a498c84}{DGRRoutingLinkRecord::PointToPoint}})}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00442}00442\ \ \ \ \ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00443}00443\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ os\ <<\ \textcolor{stringliteral}{"{}\ (DGRRoutingLinkRecord::PointToPoint)"{}}\ <<\ std::endl;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00444}00444\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ os\ <<\ \textcolor{stringliteral}{"{}m\_linkId\ =\ "{}}\ <<\ p-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_a19605f0540a6904bd5801a7e1bd07895}{m\_linkId}}\ <<\ std::endl;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00445}00445\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ os\ <<\ \textcolor{stringliteral}{"{}m\_linkData\ =\ "{}}\ <<\ p-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_a90859ad36a2936e26b9e933a323e35df}{m\_linkData}}\ <<\ std::endl;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00446}00446\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ os\ <<\ \textcolor{stringliteral}{"{}m\_metric\ =\ "{}}\ <<\ p-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_ad36a9c3468f8ca6ef6335eff2dfca4fe}{m\_metric}}\ <<\ std::endl;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00447}00447\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00448}00448\ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (p-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_ae33ce84e5118670a92ec8253b4e35a6e}{m\_linkType}}\ ==\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_a93b89b9f89407a39712186911ad12a4baa0b0a272a289d2f1fcafdfedcde669b7}{DGRRoutingLinkRecord::TransitNetwork}})}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00449}00449\ \ \ \ \ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00450}00450\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ os\ <<\ \textcolor{stringliteral}{"{}\ (DGRRoutingLinkRecord::TransitNetwork)"{}}\ <<\ std::endl;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00451}00451\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ os\ <<\ \textcolor{stringliteral}{"{}m\_linkId\ =\ "{}}\ <<\ p-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_a19605f0540a6904bd5801a7e1bd07895}{m\_linkId}}\ <<\ \textcolor{stringliteral}{"{}\ (Designated\ router\ for\ network)"{}}\ <<\ std::endl;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00452}00452\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ os\ <<\ \textcolor{stringliteral}{"{}m\_linkData\ =\ "{}}\ <<\ p-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_a90859ad36a2936e26b9e933a323e35df}{m\_linkData}}\ <<\ \textcolor{stringliteral}{"{}\ (This\ router's\ IP\ address)"{}}\ <<\ std::endl;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00453}00453\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ os\ <<\ \textcolor{stringliteral}{"{}m\_metric\ =\ "{}}\ <<\ p-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_ad36a9c3468f8ca6ef6335eff2dfca4fe}{m\_metric}}\ <<\ std::endl;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00454}00454\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00455}00455\ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (p-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_ae33ce84e5118670a92ec8253b4e35a6e}{m\_linkType}}\ ==\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_a93b89b9f89407a39712186911ad12a4ba31c95bb0542fb4fab6cb056f88eea561}{DGRRoutingLinkRecord::StubNetwork}})}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00456}00456\ \ \ \ \ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00457}00457\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ os\ <<\ \textcolor{stringliteral}{"{}\ (DGRRoutingLinkRecord::StubNetwork)"{}}\ <<\ std::endl;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00458}00458\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ os\ <<\ \textcolor{stringliteral}{"{}m\_linkId\ =\ "{}}\ <<\ p-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_a19605f0540a6904bd5801a7e1bd07895}{m\_linkId}}\ <<\ \textcolor{stringliteral}{"{}\ (Network\ number\ of\ attached\ network)"{}}\ <<\ std::endl;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00459}00459\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ os\ <<\ \textcolor{stringliteral}{"{}m\_linkData\ =\ "{}}\ <<\ p-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_a90859ad36a2936e26b9e933a323e35df}{m\_linkData}}\ <<\ \textcolor{stringliteral}{"{}\ (Network\ mask\ of\ attached\ network)"{}}\ <<\ std::endl;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00460}00460\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ os\ <<\ \textcolor{stringliteral}{"{}m\_metric\ =\ "{}}\ <<\ p-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_ad36a9c3468f8ca6ef6335eff2dfca4fe}{m\_metric}}\ <<\ std::endl;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00461}00461\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00462}00462\ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00463}00463\ \ \ \ \ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00464}00464\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ os\ <<\ \textcolor{stringliteral}{"{}\ (Unknown\ LinkType)"{}}\ <<\ std::endl;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00465}00465\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ os\ <<\ \textcolor{stringliteral}{"{}m\_linkId\ =\ "{}}\ <<\ p-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_a19605f0540a6904bd5801a7e1bd07895}{m\_linkId}}\ <<\ std::endl;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00466}00466\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ os\ <<\ \textcolor{stringliteral}{"{}m\_linkData\ =\ "{}}\ <<\ p-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_a90859ad36a2936e26b9e933a323e35df}{m\_linkData}}\ <<\ std::endl;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00467}00467\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ os\ <<\ \textcolor{stringliteral}{"{}m\_metric\ =\ "{}}\ <<\ p-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_ad36a9c3468f8ca6ef6335eff2dfca4fe}{m\_metric}}\ <<\ std::endl;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00468}00468\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00469}00469\ \ \ \ \ \ \ \ \ \ \ os\ <<\ \textcolor{stringliteral}{"{}-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/\ End\ RouterLSA\ Link\ Record\ -\/-\/-\/-\/-\/-\/-\/-\/-\/-\/"{}}\ <<\ std::endl;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00470}00470\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00471}00471\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00472}00472\ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_ae6c045e56d285913bdc92870f0e0ce45}{m\_lsType}}\ ==\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a38d676a01a677ff003f198d454cf0694a5d51f5653b9ddf1d8bf640932068cb85}{DGRRoutingLSA::NetworkLSA}})\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00473}00473\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00474}00474\ \ \ \ \ \ \ os\ <<\ \textcolor{stringliteral}{"{}-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/\ NetworkLSA\ Link\ Record\ -\/-\/-\/-\/-\/-\/-\/-\/-\/-\/"{}}\ <<\ std::endl;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00475}00475\ \ \ \ \ \ \ os\ <<\ \textcolor{stringliteral}{"{}m\_networkLSANetworkMask\ =\ "{}}\ <<\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a96b6a315aabd6e6067d627a47f755d39}{m\_networkLSANetworkMask}}\ <<\ std::endl;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00476}00476\ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\ ListOfAttachedRouters\_t::const\_iterator\ \mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}}\ =\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a41531661fa28a374064823c36171ae0b}{m\_attachedRouters}}.begin\ ();\ \mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}}\ !=\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a41531661fa28a374064823c36171ae0b}{m\_attachedRouters}}.end\ ();\ \mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}}++)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00477}00477\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00478}00478\ \ \ \ \ \ \ \ \ \ \ Ipv4Address\ p\ =\ *\mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00479}00479\ \ \ \ \ \ \ \ \ \ \ os\ <<\ \textcolor{stringliteral}{"{}attachedRouter\ =\ "{}}\ <<\ p\ <<\ std::endl;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00480}00480\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00481}00481\ \ \ \ \ \ \ os\ <<\ \textcolor{stringliteral}{"{}-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/\ End\ NetworkLSA\ Link\ Record\ -\/-\/-\/-\/-\/-\/-\/-\/-\/-\/"{}}\ <<\ std::endl;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00482}00482\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00483}00483\ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_ae6c045e56d285913bdc92870f0e0ce45}{m\_lsType}}\ ==\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a38d676a01a677ff003f198d454cf0694aca69c3cdc30b0ddcb8dd1dd95f79065a}{DGRRoutingLSA::ASExternalLSAs}})}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00484}00484\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00485}00485\ \ \ \ \ \ \ os\ <<\ \textcolor{stringliteral}{"{}-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/\ ASExternalLSA\ Link\ Record\ -\/-\/-\/-\/-\/-\/-\/-\/"{}}\ <<\ std::endl;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00486}00486\ \ \ \ \ \ \ os\ <<\ \textcolor{stringliteral}{"{}m\_linkStateId\ =\ "{}}\ <<\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a7934180d82eeada95c7c0918438f8f54}{m\_linkStateId}}\ <<\ std::endl;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00487}00487\ \ \ \ \ \ \ os\ <<\ \textcolor{stringliteral}{"{}m\_networkLSANetworkMask\ =\ "{}}\ <<\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a96b6a315aabd6e6067d627a47f755d39}{m\_networkLSANetworkMask}}\ <<\ std::endl;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00488}00488\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00489}00489\ \ \ \textcolor{keywordflow}{else}\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00490}00490\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00491}00491\ \ \ \ \ \ \ NS\_ASSERT\_MSG\ (0,\ \textcolor{stringliteral}{"{}Illegal\ LSA\ LSType:\ "{}}\ <<\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_ae6c045e56d285913bdc92870f0e0ce45}{m\_lsType}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00492}00492\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00493}00493\ \ \ os\ <<\ \textcolor{stringliteral}{"{}==========\ End\ Global\ Routing\ LSA\ =========="{}}\ <<\ std::endl;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00494}00494\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00495}00495\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00496}\mbox{\hyperlink{namespacens3_a8f9cbacbe18b24253f5246dd5ea3bb1c}{00496}}\ std::ostream\&\ \mbox{\hyperlink{namespacens3_a7c0f3fcc4f4363c5458911cded1af4b6}{operator<<\ }}(std::ostream\&\ os,\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a}{DGRRoutingLSA}}\&\ lsa)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00497}00497\ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00498}00498\ \ \ lsa.\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a46f99ef0058670ce83157f4ab482aaee}{Print}}\ (os);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00499}00499\ \ \ \textcolor{keywordflow}{return}\ os;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00500}00500\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00501}00501\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00502}00502\ \textcolor{comment}{//\ -\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00503}00503\ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00504}00504\ \textcolor{comment}{//\ DGRRouter\ Implementation}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00505}00505\ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00506}00506\ \textcolor{comment}{//\ -\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00507}00507\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00508}\mbox{\hyperlink{namespacens3_a267728ed47f35aa67aa44af055645771}{00508}}\ \mbox{\hyperlink{namespacens3_aef8bf32b4f2f98d854532bfb36d47a7c}{NS\_OBJECT\_ENSURE\_REGISTERED}}\ (\mbox{\hyperlink{classns3_1_1_d_g_r_router}{DGRRouter}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00509}00509\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00510}00510\ TypeId\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00511}\mbox{\hyperlink{classns3_1_1_d_g_r_router_a5e4510d23ed9e20780dc25f60e8fc6e4}{00511}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_a5e4510d23ed9e20780dc25f60e8fc6e4}{DGRRouter::GetTypeId}}\ (\textcolor{keywordtype}{void})}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00512}00512\ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00513}00513\ \ \ \textcolor{keyword}{static}\ TypeId\ tid\ =\ TypeId\ (\textcolor{stringliteral}{"{}ns3::DGRRouter"{}})}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00514}00514\ \ \ \ \ .SetParent<\mbox{\hyperlink{class_object}{Object}}>\ ()}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00515}00515\ \ \ \ \ .SetGroupName\ (\textcolor{stringliteral}{"{}dgr"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00516}00516\ \ \ \textcolor{keywordflow}{return}\ tid;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00517}00517\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00518}00518\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00519}\mbox{\hyperlink{classns3_1_1_d_g_r_router_a0bd2dfa51885b1dc89d7dfcb88435803}{00519}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_a0bd2dfa51885b1dc89d7dfcb88435803}{DGRRouter::DGRRouter}}\ ()}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00520}00520\ \ \ :\ m\_LSAs\ ()}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00521}00521\ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00522}00522\ \ \ NS\_LOG\_FUNCTION\ (\textcolor{keyword}{this});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00523}00523\ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_router_ad5a4a0b95c697c5121ee5096dfb1da61}{m\_routerId}}.Set\ (\mbox{\hyperlink{classns3_1_1_d_g_r_route_manager_a87bf2995a6dcd48692147452fea88d40}{DGRRouteManager::AllocateRouterId}}\ ());}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00524}00524\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00525}00525\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00526}\mbox{\hyperlink{classns3_1_1_d_g_r_router_af0515aa6e787213f0d24aeae066261e7}{00526}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_af0515aa6e787213f0d24aeae066261e7}{DGRRouter::\string~DGRRouter}}\ ()}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00527}00527\ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00528}00528\ \ \ NS\_LOG\_FUNCTION\ (\textcolor{keyword}{this});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00529}00529\ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_router_a2b22b001dff03d6d86ba7003104d8a26}{ClearLSAs}}\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00530}00530\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00531}00531\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00532}00532\ \textcolor{keywordtype}{void}\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00533}\mbox{\hyperlink{classns3_1_1_d_g_r_router_ad311356106cc37bb8b0c140e42a8102c}{00533}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_ad311356106cc37bb8b0c140e42a8102c}{DGRRouter::SetRoutingProtocol}}\ (Ptr<Ipv4DGRRouting>\ routing)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00534}00534\ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00535}00535\ \ \ NS\_LOG\_FUNCTION\ (\textcolor{keyword}{this}\ <<\ routing);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00536}00536\ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_router_aa705acbc7504f36647b15d3771ec7a5c}{m\_routingProtocol}}\ =\ routing;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00537}00537\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00538}00538\ Ptr<Ipv4DGRRouting>\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00539}\mbox{\hyperlink{classns3_1_1_d_g_r_router_a87f63cac54a25accafa7c849a9aa0dbc}{00539}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_a87f63cac54a25accafa7c849a9aa0dbc}{DGRRouter::GetRoutingProtocol}}\ (\textcolor{keywordtype}{void})}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00540}00540\ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00541}00541\ \ \ NS\_LOG\_FUNCTION\ (\textcolor{keyword}{this});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00542}00542\ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_aa705acbc7504f36647b15d3771ec7a5c}{m\_routingProtocol}};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00543}00543\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00544}00544\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00545}00545\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00546}\mbox{\hyperlink{classns3_1_1_d_g_r_router_a344e058e98819ba13be13741adaddc27}{00546}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_a344e058e98819ba13be13741adaddc27}{DGRRouter::DoDispose}}\ ()}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00547}00547\ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00548}00548\ \ \ NS\_LOG\_FUNCTION\ (\textcolor{keyword}{this});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00549}00549\ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_router_aa705acbc7504f36647b15d3771ec7a5c}{m\_routingProtocol}}\ =\ 0;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00550}00550\ \ \ \textcolor{keywordflow}{for}\ (\mbox{\hyperlink{classns3_1_1_d_g_r_router_a225672861cc79568c5c6c231b45951fd}{InjectedRoutesI}}\ k\ =\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_a44d220216aad103c57fbd253f80df2b2}{m\_injectedRoutes}}.begin\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00551}00551\ \ \ \ \ \ \ \ k\ !=\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_a44d220216aad103c57fbd253f80df2b2}{m\_injectedRoutes}}.end\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00552}00552\ \ \ \ \ \ \ \ k\ =\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_a44d220216aad103c57fbd253f80df2b2}{m\_injectedRoutes}}.erase\ (k))}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00553}00553\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00554}00554\ \ \ \ \ \ \ \textcolor{keyword}{delete}\ (*k);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00555}00555\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00556}00556\ \ \ Object::DoDispose\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00557}00557\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00558}00558\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00559}00559\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00560}\mbox{\hyperlink{classns3_1_1_d_g_r_router_a2b22b001dff03d6d86ba7003104d8a26}{00560}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_a2b22b001dff03d6d86ba7003104d8a26}{DGRRouter::ClearLSAs}}\ ()}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00561}00561\ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00562}00562\ \ \ NS\_LOG\_FUNCTION\ (\textcolor{keyword}{this});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00563}00563\ \ \ \textcolor{keywordflow}{for}\ (\ ListOfLSAs\_t::iterator\ \mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}}\ =\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_aa839f56748d61a63ad55c0db58ddd07f}{m\_LSAs}}.begin\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00564}00564\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}}\ !=\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_aa839f56748d61a63ad55c0db58ddd07f}{m\_LSAs}}.end\ ();\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00565}00565\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}}++)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00566}00566\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00567}00567\ \ \ \ \ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}Free\ LSA"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00568}00568\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00569}00569\ \ \ \ \ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a}{DGRRoutingLSA}}\ *p\ =\ *\mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00570}00570\ \ \ \ \ \ \ \textcolor{keyword}{delete}\ p;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00571}00571\ \ \ \ \ \ \ p\ =\ 0;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00572}00572\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00573}00573\ \ \ \ \ \ \ *\mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}}\ =\ 0;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00574}00574\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00575}00575\ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}Clear\ list\ of\ LSAs"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00576}00576\ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_router_aa839f56748d61a63ad55c0db58ddd07f}{m\_LSAs}}.clear\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00577}00577\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00578}00578\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00579}00579\ Ipv4Address}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00580}\mbox{\hyperlink{classns3_1_1_d_g_r_router_ad8375eec1264922d460ba8a5978f4ace}{00580}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_ad8375eec1264922d460ba8a5978f4ace}{DGRRouter::GetRouterId}}\ (\textcolor{keywordtype}{void})\textcolor{keyword}{\ const}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00581}00581\ \textcolor{keyword}{}\{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00582}00582\ \ \ NS\_LOG\_FUNCTION\ (\textcolor{keyword}{this});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00583}00583\ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_ad5a4a0b95c697c5121ee5096dfb1da61}{m\_routerId}};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00584}00584\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00585}00585\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00586}00586\ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00587}00587\ \textcolor{comment}{//\ DiscoverLSAs\ is\ called\ on\ all\ nodes\ in\ the\ system\ that\ have\ a\ DGRRouter}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00588}00588\ \textcolor{comment}{//\ interface\ aggregated.\ \ We\ need\ to\ go\ out\ and\ discover\ any\ adjacent\ routers\ }}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00589}00589\ \textcolor{comment}{//\ and\ build\ the\ Link\ State\ Advertisements\ that\ reflect\ them\ and\ their\ associated}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00590}00590\ \textcolor{comment}{//\ networks.}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00591}00591\ \textcolor{comment}{//\ }}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00592}00592\ uint32\_t\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00593}\mbox{\hyperlink{classns3_1_1_d_g_r_router_ac119cda89d816da90186bb617c710c25}{00593}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_ac119cda89d816da90186bb617c710c25}{DGRRouter::DiscoverLSAs}}\ ()}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00594}00594\ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00595}00595\ \ \ NS\_LOG\_FUNCTION\ (\textcolor{keyword}{this});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00596}00596\ \ \ Ptr<Node>\ node\ =\ GetObject<Node>\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00597}00597\ \ \ NS\_ABORT\_MSG\_UNLESS\ (node,\ \textcolor{stringliteral}{"{}DGRRouter::DiscoverLSAs\ ():\ GetObject\ for\ <Node>\ interface\ failed"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00598}00598\ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}For\ node\ "{}}\ <<\ node-\/>GetId\ ()\ );}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00599}00599\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00600}00600\ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_router_a2b22b001dff03d6d86ba7003104d8a26}{ClearLSAs}}\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00601}00601\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00602}00602\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00603}00603\ \ \ \textcolor{comment}{//\ While\ building\ the\ Router-\/LSA,\ keep\ a\ list\ of\ those\ NetDevices\ for}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00604}00604\ \ \ \textcolor{comment}{//\ which\ the\ current\ node\ is\ the\ designated\ router\ and\ we\ will\ later\ build\ }}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00605}00605\ \ \ \textcolor{comment}{//\ a\ NetworkLSA\ for.}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00606}00606\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00607}00607\ \ \ NetDeviceContainer\ c;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00608}00608\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00609}00609\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00610}00610\ \ \ \textcolor{comment}{//\ We're\ aggregated\ to\ a\ node.\ \ We\ need\ to\ ask\ the\ node\ for\ a\ pointer\ to\ its}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00611}00611\ \ \ \textcolor{comment}{//\ Ipv4\ interface.\ \ This\ is\ where\ the\ information\ regarding\ the\ attached\ }}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00612}00612\ \ \ \textcolor{comment}{//\ interfaces\ lives.\ \ If\ we're\ a\ router,\ we\ had\ better\ have\ an\ Ipv4\ interface.}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00613}00613\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00614}00614\ \ \ Ptr<Ipv4>\ ipv4Local\ =\ node-\/>GetObject<Ipv4>\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00615}00615\ \ \ NS\_ABORT\_MSG\_UNLESS\ (ipv4Local,\ \textcolor{stringliteral}{"{}DGRRouter::DiscoverLSAs\ ():\ GetObject\ for\ <Ipv4>\ interface\ failed"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00616}00616\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00617}00617\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00618}00618\ \ \ \textcolor{comment}{//\ Every\ router\ node\ originates\ a\ Router-\/LSA}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00619}00619\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00620}00620\ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a}{DGRRoutingLSA}}\ *pLSA\ =\ \textcolor{keyword}{new}\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a}{DGRRoutingLSA}};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00621}00621\ \ \ pLSA-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a898720f0e7c926c4ecd2ca89d09363dd}{SetLSType}}\ (\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a38d676a01a677ff003f198d454cf0694a0322ce07c2b94cdb14163bbe04cb9674}{DGRRoutingLSA::RouterLSA}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00622}00622\ \ \ pLSA-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a382594771f20561edde6e6b53d3bd982}{SetLinkStateId}}\ (\mbox{\hyperlink{classns3_1_1_d_g_r_router_ad5a4a0b95c697c5121ee5096dfb1da61}{m\_routerId}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00623}00623\ \ \ pLSA-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a5f36eb9409d5d6532b9bd267e8d90f61}{SetAdvertisingRouter}}\ (\mbox{\hyperlink{classns3_1_1_d_g_r_router_ad5a4a0b95c697c5121ee5096dfb1da61}{m\_routerId}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00624}00624\ \ \ pLSA-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a497453d1271c0020968487ec8ead99c5}{SetStatus}}\ (\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a2d6cf227cde572e9c99d273a0e0fa5f7ac563232b34162339268c7804c93765ad}{DGRRoutingLSA::LSA\_SPF\_NOT\_EXPLORED}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00625}00625\ \ \ pLSA-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a5fb6e248545fbd3d50b34429e4780746}{SetNode}}\ (node);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00626}00626\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00627}00627\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00628}00628\ \ \ \textcolor{comment}{//\ Ask\ the\ node\ for\ the\ number\ of\ net\ devices\ attached.\ This\ isn't\ necessarily\ }}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00629}00629\ \ \ \textcolor{comment}{//\ equal\ to\ the\ number\ of\ links\ to\ adjacent\ nodes\ (other\ routers)\ as\ the\ number}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00630}00630\ \ \ \textcolor{comment}{//\ of\ devices\ may\ include\ those\ for\ stub\ networks\ (e.g.,\ ethernets,\ etc.)\ and\ }}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00631}00631\ \ \ \textcolor{comment}{//\ bridge\ devices\ also\ take\ up\ an\ "{}extra"{}\ net\ device.}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00632}00632\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00633}00633\ \ \ uint32\_t\ numDevices\ =\ node-\/>GetNDevices\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00634}00634\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00635}00635\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00636}00636\ \ \ \textcolor{comment}{//\ Iterate\ through\ the\ devices\ on\ the\ node\ and\ walk\ the\ channel\ to\ see\ what's}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00637}00637\ \ \ \textcolor{comment}{//\ on\ the\ other\ side\ of\ the\ standalone\ devices..}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00638}00638\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00639}00639\ \ \ \textcolor{keywordflow}{for}\ (uint32\_t\ \mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}}\ =\ 0;\ \mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}}\ <\ numDevices;\ ++\mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}})}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00640}00640\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00641}00641\ \ \ \ \ \ \ Ptr<NetDevice>\ ndLocal\ =\ node-\/>GetDevice\ (\mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00642}00642\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00643}00643\ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (DynamicCast\ <LoopbackNetDevice>\ (ndLocal))}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00644}00644\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00645}00645\ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00646}00646\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00647}00647\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00648}00648\ \ \ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00649}00649\ \ \ \ \ \ \ \textcolor{comment}{//\ There\ is\ an\ assumption\ that\ bridge\ ports\ must\ never\ have\ an\ IP\ address\ }}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00650}00650\ \ \ \ \ \ \ \textcolor{comment}{//\ associated\ with\ them.\ \ This\ turns\ out\ to\ be\ a\ very\ convenient\ place\ to}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00651}00651\ \ \ \ \ \ \ \textcolor{comment}{//\ check\ and\ make\ sure\ that\ this\ is\ the\ case.}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00652}00652\ \ \ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00653}00653\ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\mbox{\hyperlink{classns3_1_1_d_g_r_router_a53fdf9c96432439b34d091da6050890b}{NetDeviceIsBridged}}\ (ndLocal))}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00654}00654\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00655}00655\ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Initialize\ to\ value\ out\ of\ bounds\ to\ silence\ compiler}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00656}00656\ \ \ \ \ \ \ \ \ \ \ uint32\_t\ interfaceBridge\ =\ ipv4Local-\/>GetNInterfaces\ ()\ +\ 1;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00657}00657\ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{bool}\ rc\ =\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_a817add200a30892091534c2d42fa43e5}{FindInterfaceForDevice}}\ (node,\ ndLocal,\ interfaceBridge);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00658}00658\ \ \ \ \ \ \ \ \ \ \ NS\_ABORT\_MSG\_IF\ (rc,\ \textcolor{stringliteral}{"{}DGRRouter::DiscoverLSAs():\ Bridge\ ports\ must\ not\ have\ an\ IPv4\ interface\ index"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00659}00659\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00660}00660\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00661}00661\ \ \ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00662}00662\ \ \ \ \ \ \ \textcolor{comment}{//\ Check\ to\ see\ if\ the\ net\ device\ we\ just\ got\ has\ a\ corresponding\ IP\ }}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00663}00663\ \ \ \ \ \ \ \textcolor{comment}{//\ interface\ (could\ be\ a\ pure\ L2\ NetDevice)\ -\/-\/\ for\ example\ a\ net\ device}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00664}00664\ \ \ \ \ \ \ \textcolor{comment}{//\ associated\ with\ a\ bridge.\ \ We\ are\ only\ going\ to\ involve\ devices\ with\ }}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00665}00665\ \ \ \ \ \ \ \textcolor{comment}{//\ IP\ addresses\ in\ routing.}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00666}00666\ \ \ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00667}00667\ \ \ \ \ \ \ \textcolor{keywordtype}{bool}\ isForwarding\ =\ \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00668}00668\ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (uint32\_t\ j\ =\ 0;\ j\ <\ ipv4Local-\/>GetNInterfaces\ ();\ ++j\ )}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00669}00669\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00670}00670\ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (ipv4Local-\/>GetNetDevice\ (j)\ ==\ ndLocal\ \&\&\ ipv4Local-\/>IsUp\ (j)\ \&\&}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00671}00671\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ipv4Local-\/>IsForwarding\ (j))\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00672}00672\ \ \ \ \ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00673}00673\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ isForwarding\ =\ \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00674}00674\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00675}00675\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00676}00676\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00677}00677\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00678}00678\ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!isForwarding)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00679}00679\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00680}00680\ \ \ \ \ \ \ \ \ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}Net\ device\ "{}}\ <<\ ndLocal\ <<\ \textcolor{stringliteral}{"{}has\ no\ IP\ interface\ or\ is\ not\ enabled\ for\ forwarding,\ skipping"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00681}00681\ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00682}00682\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00683}00683\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00684}00684\ \ \ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00685}00685\ \ \ \ \ \ \ \textcolor{comment}{//\ We\ have\ a\ net\ device\ that\ we\ need\ to\ check\ out.\ \ If\ it\ supports\ }}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00686}00686\ \ \ \ \ \ \ \textcolor{comment}{//\ broadcast\ and\ is\ not\ a\ point-\/point\ link,\ then\ it\ will\ be\ either\ a\ stub\ }}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00687}00687\ \ \ \ \ \ \ \textcolor{comment}{//\ network\ or\ a\ transit\ network\ depending\ on\ the\ number\ of\ routers\ on}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00688}00688\ \ \ \ \ \ \ \textcolor{comment}{//\ the\ segment.\ \ We\ add\ the\ appropriate\ link\ record\ to\ the\ LSA.}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00689}00689\ \ \ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00690}00690\ \ \ \ \ \ \ \textcolor{comment}{//\ If\ the\ device\ is\ a\ point\ to\ point\ link,\ we\ treat\ it\ separately.\ \ In}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00691}00691\ \ \ \ \ \ \ \textcolor{comment}{//\ that\ case,\ there\ may\ be\ zero,\ one,\ or\ two\ link\ records\ added.}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00692}00692\ \ \ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00693}00693\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00694}00694\ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (ndLocal-\/>IsBroadcast\ ()\ \&\&\ !ndLocal-\/>IsPointToPoint\ ()\ )}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00695}00695\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00696}00696\ \ \ \ \ \ \ \ \ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}Broadcast\ link"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00697}00697\ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_router_aa562c84d9a117e26103ac8338ec8094f}{ProcessBroadcastLink}}\ (ndLocal,\ pLSA,\ c);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00698}00698\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00699}00699\ \ \ \ \ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (ndLocal-\/>IsPointToPoint\ ()\ )}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00700}00700\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00701}00701\ \ \ \ \ \ \ \ \ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}Point=to-\/point\ link"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00702}00702\ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_router_aac014913150c42a93cecbc6a9daf7552}{ProcessPointToPointLink}}\ (ndLocal,\ pLSA);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00703}00703\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00704}00704\ \ \ \ \ \ \ \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00705}00705\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00706}00706\ \ \ \ \ \ \ \ \ \ \ NS\_ASSERT\_MSG\ (0,\ \textcolor{stringliteral}{"{}DGRRouter::DiscoverLSAs\ ():\ unknown\ link\ type"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00707}00707\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00708}00708\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00709}00709\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00710}00710\ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}==========\ LSA\ for\ node\ "{}}\ <<\ node-\/>GetId\ ()\ <<\ \textcolor{stringliteral}{"{}\ =========="{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00711}00711\ \ \ NS\_LOG\_LOGIC\ (*pLSA);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00712}00712\ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_router_aa839f56748d61a63ad55c0db58ddd07f}{m\_LSAs}}.push\_back\ (pLSA);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00713}00713\ \ \ pLSA\ =\ 0;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00714}00714\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00715}00715\ \ \ \textcolor{comment}{//\ }}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00716}00716\ \ \ \textcolor{comment}{//\ Now,\ determine\ whether\ we\ need\ to\ build\ a\ NetworkLSA.\ \ This\ is\ the\ case\ if}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00717}00717\ \ \ \textcolor{comment}{//\ we\ found\ at\ least\ one\ designated\ router.}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00718}00718\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00719}00719\ \ \ uint32\_t\ nDesignatedRouters\ =\ c.GetN\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00720}00720\ \ \ \textcolor{keywordflow}{if}\ (nDesignatedRouters\ >\ 0)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00721}00721\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00722}00722\ \ \ \ \ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}Build\ Network\ LSAs"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00723}00723\ \ \ \ \ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_router_a045a362fddd31a11a9c777bb64c889f7}{BuildNetworkLSAs}}\ (c);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00724}00724\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00725}00725\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00726}00726\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00727}00727\ \ \ \textcolor{comment}{//\ Build\ injected\ route\ LSAs\ as\ external\ routes}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00728}00728\ \ \ \textcolor{comment}{//\ RFC\ 2328,\ section\ 12.4.4}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00729}00729\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00730}00730\ \ \ \textcolor{keywordflow}{for}\ (\mbox{\hyperlink{classns3_1_1_d_g_r_router_a45ba88a691f800f523041ad82ce36f91}{InjectedRoutesCI}}\ \mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}}\ =\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_a44d220216aad103c57fbd253f80df2b2}{m\_injectedRoutes}}.begin\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00731}00731\ \ \ \ \ \ \ \ \mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}}\ !=\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_a44d220216aad103c57fbd253f80df2b2}{m\_injectedRoutes}}.end\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00732}00732\ \ \ \ \ \ \ \ \mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}}++)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00733}00733\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00734}00734\ \ \ \ \ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a}{DGRRoutingLSA}}\ *pLSA\ =\ \textcolor{keyword}{new}\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a}{DGRRoutingLSA}};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00735}00735\ \ \ \ \ \ \ pLSA-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a898720f0e7c926c4ecd2ca89d09363dd}{SetLSType}}\ (\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a38d676a01a677ff003f198d454cf0694aca69c3cdc30b0ddcb8dd1dd95f79065a}{DGRRoutingLSA::ASExternalLSAs}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00736}00736\ \ \ \ \ \ \ pLSA-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a382594771f20561edde6e6b53d3bd982}{SetLinkStateId}}\ ((*i)-\/>GetDestNetwork\ ());}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00737}00737\ \ \ \ \ \ \ pLSA-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a5f36eb9409d5d6532b9bd267e8d90f61}{SetAdvertisingRouter}}\ (\mbox{\hyperlink{classns3_1_1_d_g_r_router_ad5a4a0b95c697c5121ee5096dfb1da61}{m\_routerId}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00738}00738\ \ \ \ \ \ \ pLSA-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a1d60ee05ffc0dd4d434fb12917f6c83e}{SetNetworkLSANetworkMask}}\ ((*i)-\/>GetDestNetworkMask\ ());}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00739}00739\ \ \ \ \ \ \ pLSA-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a497453d1271c0020968487ec8ead99c5}{SetStatus}}\ (\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a2d6cf227cde572e9c99d273a0e0fa5f7ac563232b34162339268c7804c93765ad}{DGRRoutingLSA::LSA\_SPF\_NOT\_EXPLORED}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00740}00740\ \ \ \ \ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_router_aa839f56748d61a63ad55c0db58ddd07f}{m\_LSAs}}.push\_back\ (pLSA);\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00741}00741\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00742}00742\ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_aa839f56748d61a63ad55c0db58ddd07f}{m\_LSAs}}.size\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00743}00743\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00744}00744\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00745}00745\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00746}\mbox{\hyperlink{classns3_1_1_d_g_r_router_aa562c84d9a117e26103ac8338ec8094f}{00746}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_aa562c84d9a117e26103ac8338ec8094f}{DGRRouter::ProcessBroadcastLink}}\ (Ptr<NetDevice>\ nd,\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a}{DGRRoutingLSA}}\ *pLSA,\ NetDeviceContainer\ \&c)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00747}00747\ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00748}00748\ \ \ NS\_LOG\_FUNCTION\ (\textcolor{keyword}{this}\ <<\ nd\ <<\ pLSA\ <<\ \&c);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00749}00749\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00750}00750\ \ \ \textcolor{keywordflow}{if}\ (nd-\/>IsBridge\ ())}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00751}00751\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00752}00752\ \ \ \ \ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_router_ac1075dd7ea9735e489838a39e29f6597}{ProcessBridgedBroadcastLink}}\ (nd,\ pLSA,\ c);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00753}00753\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00754}00754\ \ \ \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00755}00755\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00756}00756\ \ \ \ \ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_router_a920b7e48d18135f51a66b010b6d730cc}{ProcessSingleBroadcastLink}}\ (nd,\ pLSA,\ c);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00757}00757\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00758}00758\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00759}00759\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00760}00760\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00761}\mbox{\hyperlink{classns3_1_1_d_g_r_router_a920b7e48d18135f51a66b010b6d730cc}{00761}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_a920b7e48d18135f51a66b010b6d730cc}{DGRRouter::ProcessSingleBroadcastLink}}\ (Ptr<NetDevice>\ nd,\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a}{DGRRoutingLSA}}\ *pLSA,\ NetDeviceContainer\ \&c)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00762}00762\ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00763}00763\ \ \ NS\_LOG\_FUNCTION\ (\textcolor{keyword}{this}\ <<\ nd\ <<\ pLSA\ <<\ \&c);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00764}00764\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00765}00765\ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record}{DGRRoutingLinkRecord}}\ *plr\ =\ \textcolor{keyword}{new}\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record}{DGRRoutingLinkRecord}};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00766}00766\ \ \ NS\_ABORT\_MSG\_IF\ (plr\ ==\ 0,\ \textcolor{stringliteral}{"{}DGRRouter::ProcessSingleBroadcastLink():\ Can't\ alloc\ link\ record"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00767}00767\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00768}00768\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00769}00769\ \ \ \textcolor{comment}{//\ We\ have\ some\ preliminaries\ to\ do\ to\ get\ enough\ information\ to\ proceed.}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00770}00770\ \ \ \textcolor{comment}{//\ This\ information\ we\ need\ comes\ from\ the\ internet\ stack,\ so\ notice\ that}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00771}00771\ \ \ \textcolor{comment}{//\ there\ is\ an\ implied\ assumption\ that\ global\ routing\ is\ only\ going\ to\ }}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00772}00772\ \ \ \textcolor{comment}{//\ work\ with\ devices\ attached\ to\ the\ internet\ stack\ (have\ an\ ipv4\ interface}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00773}00773\ \ \ \textcolor{comment}{//\ associated\ to\ them.}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00774}00774\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00775}00775\ \ \ Ptr<Node>\ node\ =\ nd-\/>GetNode\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00776}00776\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00777}00777\ \ \ Ptr<Ipv4>\ ipv4Local\ =\ node-\/>GetObject<Ipv4>\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00778}00778\ \ \ NS\_ABORT\_MSG\_UNLESS\ (ipv4Local,\ \textcolor{stringliteral}{"{}DGRRouter::ProcessSingleBroadcastLink\ ():\ GetObject\ for\ <Ipv4>\ interface\ failed"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00779}00779\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00780}00780\ \ \ \textcolor{comment}{//\ Initialize\ to\ value\ out\ of\ bounds\ to\ silence\ compiler}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00781}00781\ \ \ uint32\_t\ interfaceLocal\ =\ ipv4Local-\/>GetNInterfaces\ ()\ +\ 1;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00782}00782\ \ \ \textcolor{keywordtype}{bool}\ rc\ =\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_a817add200a30892091534c2d42fa43e5}{FindInterfaceForDevice}}\ (node,\ nd,\ interfaceLocal);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00783}00783\ \ \ NS\_ABORT\_MSG\_IF\ (rc\ ==\ \textcolor{keyword}{false},\ \textcolor{stringliteral}{"{}DGRRouter::ProcessSingleBroadcastLink():\ No\ interface\ index\ associated\ with\ device"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00784}00784\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00785}00785\ \ \ \textcolor{keywordflow}{if}\ (ipv4Local-\/>GetNAddresses\ (interfaceLocal)\ >\ 1)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00786}00786\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00787}00787\ \ \ \ \ \ \ NS\_LOG\_WARN\ (\textcolor{stringliteral}{"{}Warning,\ interface\ has\ multiple\ IP\ addresses;\ using\ only\ the\ primary\ one"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00788}00788\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00789}00789\ \ \ Ipv4Address\ addrLocal\ =\ ipv4Local-\/>GetAddress\ (interfaceLocal,\ 0).GetLocal\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00790}00790\ \ \ Ipv4Mask\ maskLocal\ =\ ipv4Local-\/>GetAddress\ (interfaceLocal,\ 0).GetMask\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00791}00791\ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}Working\ with\ local\ address\ "{}}\ <<\ addrLocal);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00792}00792\ \ \ uint16\_t\ metricLocal\ =\ ipv4Local-\/>GetMetric\ (interfaceLocal);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00793}00793\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00794}00794\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00795}00795\ \ \ \textcolor{comment}{//\ Check\ to\ see\ if\ the\ net\ device\ is\ connected\ to\ a\ channel/network\ that\ has}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00796}00796\ \ \ \textcolor{comment}{//\ another\ router\ on\ it.\ \ If\ there\ is\ no\ other\ router\ on\ the\ link\ (but\ us)\ then}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00797}00797\ \ \ \textcolor{comment}{//\ this\ is\ a\ stub\ network.\ \ If\ we\ find\ another\ router,\ then\ what\ we\ have\ here}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00798}00798\ \ \ \textcolor{comment}{//\ is\ a\ transit\ network.}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00799}00799\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00800}00800\ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_router_a9c480fca2799ed5e445820561087500e}{ClearBridgesVisited}}\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00801}00801\ \ \ \textcolor{keywordflow}{if}\ (\mbox{\hyperlink{classns3_1_1_d_g_r_router_ad1f4d3739e9972e6126b4f3c61b48cc3}{AnotherRouterOnLink}}\ (nd)\ ==\ \textcolor{keyword}{false})}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00802}00802\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00803}00803\ \ \ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00804}00804\ \ \ \ \ \ \ \textcolor{comment}{//\ This\ is\ a\ net\ device\ connected\ to\ a\ stub\ network}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00805}00805\ \ \ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00806}00806\ \ \ \ \ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}Router-\/LSA\ Stub\ Network"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00807}00807\ \ \ \ \ \ \ plr-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_aacc16a8566cd389fd974cbeb8dde6ddd}{SetLinkType}}\ (\mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_a93b89b9f89407a39712186911ad12a4ba31c95bb0542fb4fab6cb056f88eea561}{DGRRoutingLinkRecord::StubNetwork}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00808}00808\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00809}00809\ \ \ \ \ \ \ \textcolor{comment}{//\ }}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00810}00810\ \ \ \ \ \ \ \textcolor{comment}{//\ According\ to\ OSPF,\ the\ Link\ ID\ is\ the\ IP\ network\ number\ of\ }}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00811}00811\ \ \ \ \ \ \ \textcolor{comment}{//\ the\ attached\ network.}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00812}00812\ \ \ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00813}00813\ \ \ \ \ \ \ plr-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_a203541f10ca13f9cfb1987fbbff4416b}{SetLinkId}}\ (addrLocal.CombineMask\ (maskLocal));}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00814}00814\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00815}00815\ \ \ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00816}00816\ \ \ \ \ \ \ \textcolor{comment}{//\ and\ the\ Link\ Data\ is\ the\ network\ mask;\ converted\ to\ Ipv4Address}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00817}00817\ \ \ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00818}00818\ \ \ \ \ \ \ Ipv4Address\ maskLocalAddr;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00819}00819\ \ \ \ \ \ \ maskLocalAddr.Set\ (maskLocal.Get\ ());}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00820}00820\ \ \ \ \ \ \ plr-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_a06083e776955f21fe1fd4e4927cf0b24}{SetLinkData}}\ (maskLocalAddr);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00821}00821\ \ \ \ \ \ \ plr-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_ac6b9632b024b3799a25209f1392c1ab8}{SetMetric}}\ (metricLocal);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00822}00822\ \ \ \ \ \ \ pLSA-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a4b21b880eb8b7b733039d0dfaa8b48a4}{AddLinkRecord}}\ (plr);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00823}00823\ \ \ \ \ \ \ plr\ =\ 0;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00824}00824\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00825}00825\ \ \ \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00826}00826\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00827}00827\ \ \ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00828}00828\ \ \ \ \ \ \ \textcolor{comment}{//\ We\ have\ multiple\ routers\ on\ a\ broadcast\ interface,\ so\ this\ is}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00829}00829\ \ \ \ \ \ \ \textcolor{comment}{//\ a\ transit\ network.}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00830}00830\ \ \ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00831}00831\ \ \ \ \ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}Router-\/LSA\ Transit\ Network"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00832}00832\ \ \ \ \ \ \ plr-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_aacc16a8566cd389fd974cbeb8dde6ddd}{SetLinkType}}\ (\mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_a93b89b9f89407a39712186911ad12a4baa0b0a272a289d2f1fcafdfedcde669b7}{DGRRoutingLinkRecord::TransitNetwork}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00833}00833\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00834}00834\ \ \ \ \ \ \ \textcolor{comment}{//\ }}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00835}00835\ \ \ \ \ \ \ \textcolor{comment}{//\ By\ definition,\ the\ router\ with\ the\ lowest\ IP\ address\ is\ the}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00836}00836\ \ \ \ \ \ \ \textcolor{comment}{//\ designated\ router\ for\ the\ network.\ \ OSPF\ says\ that\ the\ Link\ ID}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00837}00837\ \ \ \ \ \ \ \textcolor{comment}{//\ gets\ the\ IP\ interface\ address\ of\ the\ designated\ router\ in\ this\ }}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00838}00838\ \ \ \ \ \ \ \textcolor{comment}{//\ case.}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00839}00839\ \ \ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00840}00840\ \ \ \ \ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_router_a9c480fca2799ed5e445820561087500e}{ClearBridgesVisited}}\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00841}00841\ \ \ \ \ \ \ Ipv4Address\ desigRtr;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00842}00842\ \ \ \ \ \ \ desigRtr\ =\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_a4878eacca3b0a943b4e7e49d25dd8e1b}{FindDesignatedRouterForLink}}\ (nd);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00843}00843\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00844}00844\ \ \ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00845}00845\ \ \ \ \ \ \ \textcolor{comment}{//\ Let's\ double-\/check\ that\ any\ designated\ router\ we\ find\ out\ on\ our}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00846}00846\ \ \ \ \ \ \ \textcolor{comment}{//\ network\ is\ really\ on\ our\ network.}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00847}00847\ \ \ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00848}00848\ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (desigRtr\ !=\ \textcolor{stringliteral}{"{}255.255.255.255"{}})}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00849}00849\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00850}00850\ \ \ \ \ \ \ \ \ \ \ Ipv4Address\ networkHere\ =\ addrLocal.CombineMask\ (maskLocal);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00851}00851\ \ \ \ \ \ \ \ \ \ \ Ipv4Address\ networkThere\ =\ desigRtr.CombineMask\ (maskLocal);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00852}00852\ \ \ \ \ \ \ \ \ \ \ NS\_ABORT\_MSG\_UNLESS\ (networkHere\ ==\ networkThere,}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00853}00853\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}DGRRouter::ProcessSingleBroadcastLink():\ Network\ number\ confusion\ ("{}}\ <<}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00854}00854\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ addrLocal\ <<\ \textcolor{stringliteral}{"{}/"{}}\ <<\ maskLocal.GetPrefixLength\ ()\ <<\ \textcolor{stringliteral}{"{},\ "{}}\ <<}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00855}00855\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ desigRtr\ <<\ \textcolor{stringliteral}{"{}/"{}}\ <<\ maskLocal.GetPrefixLength\ ()\ <<\ \textcolor{stringliteral}{"{})"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00856}00856\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00857}00857\ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (desigRtr\ ==\ addrLocal)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00858}00858\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00859}00859\ \ \ \ \ \ \ \ \ \ \ c.Add\ (nd);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00860}00860\ \ \ \ \ \ \ \ \ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}Node\ "{}}\ <<\ node-\/>GetId\ ()\ <<\ \textcolor{stringliteral}{"{}\ elected\ a\ designated\ router"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00861}00861\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00862}00862\ \ \ \ \ \ \ plr-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_a203541f10ca13f9cfb1987fbbff4416b}{SetLinkId}}\ (desigRtr);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00863}00863\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00864}00864\ \ \ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00865}00865\ \ \ \ \ \ \ \textcolor{comment}{//\ OSPF\ says\ that\ the\ Link\ Data\ is\ this\ router's\ own\ IP\ address.}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00866}00866\ \ \ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00867}00867\ \ \ \ \ \ \ plr-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_a06083e776955f21fe1fd4e4927cf0b24}{SetLinkData}}\ (addrLocal);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00868}00868\ \ \ \ \ \ \ plr-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_ac6b9632b024b3799a25209f1392c1ab8}{SetMetric}}\ (metricLocal);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00869}00869\ \ \ \ \ \ \ pLSA-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a4b21b880eb8b7b733039d0dfaa8b48a4}{AddLinkRecord}}\ (plr);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00870}00870\ \ \ \ \ \ \ plr\ =\ 0;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00871}00871\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00872}00872\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00873}00873\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00874}00874\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00875}\mbox{\hyperlink{classns3_1_1_d_g_r_router_ac1075dd7ea9735e489838a39e29f6597}{00875}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_ac1075dd7ea9735e489838a39e29f6597}{DGRRouter::ProcessBridgedBroadcastLink}}\ (Ptr<NetDevice>\ nd,\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a}{DGRRoutingLSA}}\ *pLSA,\ NetDeviceContainer\ \&c)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00876}00876\ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00877}00877\ \ \ NS\_LOG\_FUNCTION\ (\textcolor{keyword}{this}\ <<\ nd\ <<\ pLSA\ <<\ \&c);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00878}00878\ \ \ NS\_ASSERT\_MSG\ (nd-\/>IsBridge\ (),\ \textcolor{stringliteral}{"{}DGRRouter::ProcessBridgedBroadcastLink():\ Called\ with\ non-\/bridge\ net\ device"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00879}00879\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00880}00880\ \textcolor{preprocessor}{\#if\ 0}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00881}00881\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00882}00882\ \ \ \textcolor{comment}{//\ It\ is\ possible\ to\ admit\ the\ possibility\ that\ a\ bridge\ device\ on\ a\ node}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00883}00883\ \ \ \textcolor{comment}{//\ can\ also\ participate\ in\ routing.\ \ This\ would\ surprise\ people\ who\ don't}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00884}00884\ \ \ \textcolor{comment}{//\ come\ from\ Microsoft-\/land\ where\ they\ do\ use\ such\ a\ construct.\ \ Based\ on}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00885}00885\ \ \ \textcolor{comment}{//\ the\ principle\ of\ least-\/surprise,\ we\ will\ leave\ the\ relatively\ simple}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00886}00886\ \ \ \textcolor{comment}{//\ code\ in\ place\ to\ do\ this,\ but\ not\ enable\ it\ until\ someone\ really\ wants}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00887}00887\ \ \ \textcolor{comment}{//\ the\ capability.\ \ Even\ then,\ we\ will\ not\ enable\ this\ code\ as\ a\ default}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00888}00888\ \ \ \textcolor{comment}{//\ but\ rather\ something\ you\ will\ have\ to\ go\ and\ turn\ on.}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00889}00889\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00890}00890\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00891}00891\ \ \ Ptr<BridgeNetDevice>\ bnd\ =\ nd-\/>GetObject<BridgeNetDevice>\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00892}00892\ \ \ NS\_ABORT\_MSG\_UNLESS\ (bnd,\ \textcolor{stringliteral}{"{}DGRRouter::DiscoverLSAs\ ():\ GetObject\ for\ <BridgeNetDevice>\ failed"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00893}00893\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00894}00894\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00895}00895\ \ \ \textcolor{comment}{//\ We\ have\ some\ preliminaries\ to\ do\ to\ get\ enough\ information\ to\ proceed.}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00896}00896\ \ \ \textcolor{comment}{//\ This\ information\ we\ need\ comes\ from\ the\ internet\ stack,\ so\ notice\ that}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00897}00897\ \ \ \textcolor{comment}{//\ there\ is\ an\ implied\ assumption\ that\ global\ routing\ is\ only\ going\ to\ }}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00898}00898\ \ \ \textcolor{comment}{//\ work\ with\ devices\ attached\ to\ the\ internet\ stack\ (have\ an\ ipv4\ interface}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00899}00899\ \ \ \textcolor{comment}{//\ associated\ to\ them.}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00900}00900\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00901}00901\ \ \ Ptr<Node>\ node\ =\ nd-\/>GetNode\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00902}00902\ \ \ Ptr<Ipv4>\ ipv4Local\ =\ node-\/>GetObject<Ipv4>\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00903}00903\ \ \ NS\_ABORT\_MSG\_UNLESS\ (ipv4Local,\ \textcolor{stringliteral}{"{}DGRRouter::ProcessBridgedBroadcastLink\ ():\ GetObject\ for\ <Ipv4>\ interface\ failed"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00904}00904\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00905}00905\ \ \ \textcolor{comment}{//\ Initialize\ to\ value\ out\ of\ bounds\ to\ silence\ compiler}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00906}00906\ \ \ uint32\_t\ interfaceLocal\ =\ ipv4Local-\/>GetNInterfaces\ ()\ +\ 1;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00907}00907\ \ \ \textcolor{keywordtype}{bool}\ rc\ =\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_a817add200a30892091534c2d42fa43e5}{FindInterfaceForDevice}}\ (node,\ nd,\ interfaceLocal);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00908}00908\ \ \ NS\_ABORT\_MSG\_IF\ (rc\ ==\ \textcolor{keyword}{false},\ \textcolor{stringliteral}{"{}DGRRouter::ProcessBridgedBroadcastLink():\ No\ interface\ index\ associated\ with\ device"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00909}00909\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00910}00910\ \ \ \textcolor{keywordflow}{if}\ (ipv4Local-\/>GetNAddresses\ (interfaceLocal)\ >\ 1)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00911}00911\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00912}00912\ \ \ \ \ \ \ NS\_LOG\_WARN\ (\textcolor{stringliteral}{"{}Warning,\ interface\ has\ multiple\ IP\ addresses;\ using\ only\ the\ primary\ one"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00913}00913\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00914}00914\ \ \ Ipv4Address\ addrLocal\ =\ ipv4Local-\/>GetAddress\ (interfaceLocal,\ 0).GetLocal\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00915}00915\ \ \ Ipv4Mask\ maskLocal\ =\ ipv4Local-\/>GetAddress\ (interfaceLocal,\ 0).GetMask\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00916}00916\ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}Working\ with\ local\ address\ "{}}\ <<\ addrLocal);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00917}00917\ \ \ uint16\_t\ metricLocal\ =\ ipv4Local-\/>GetMetric\ (interfaceLocal);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00918}00918\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00919}00919\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00920}00920\ \ \ \textcolor{comment}{//\ We\ need\ to\ handle\ a\ bridge\ on\ the\ router.\ \ This\ means\ that\ we\ have\ been\ }}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00921}00921\ \ \ \textcolor{comment}{//\ given\ a\ net\ device\ that\ is\ a\ BridgeNetDevice.\ \ It\ has\ an\ associated\ Ipv4}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00922}00922\ \ \ \textcolor{comment}{//\ interface\ index\ and\ address.\ \ Some\ number\ of\ other\ net\ devices\ live\ "{}under"{}}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00923}00923\ \ \ \textcolor{comment}{//\ the\ bridge\ device\ as\ so-\/called\ bridge\ ports.\ \ In\ a\ nutshell,\ what\ we\ have}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00924}00924\ \ \ \textcolor{comment}{//\ to\ do\ is\ to\ repeat\ what\ is\ done\ for\ a\ single\ broadcast\ link\ on\ all\ of\ }}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00925}00925\ \ \ \textcolor{comment}{//\ those\ net\ devices\ living\ under\ the\ bridge\ (trolls?)}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00926}00926\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00927}00927\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00928}00928\ \ \ \textcolor{keywordtype}{bool}\ areTransitNetwork\ =\ \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00929}00929\ \ \ Ipv4Address\ desigRtr\ (\textcolor{stringliteral}{"{}255.255.255.255"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00930}00930\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00931}00931\ \ \ \textcolor{keywordflow}{for}\ (uint32\_t\ \mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}}\ =\ 0;\ \mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}}\ <\ bnd-\/>GetNBridgePorts\ ();\ ++\mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}})}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00932}00932\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00933}00933\ \ \ \ \ \ \ Ptr<NetDevice>\ ndTemp\ =\ bnd-\/>GetBridgePort\ (\mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00934}00934\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00935}00935\ \ \ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00936}00936\ \ \ \ \ \ \ \textcolor{comment}{//\ We\ have\ to\ decide\ if\ we\ are\ a\ transit\ network.\ \ This\ is\ characterized}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00937}00937\ \ \ \ \ \ \ \textcolor{comment}{//\ by\ the\ presence\ of\ another\ router\ on\ the\ network\ segment.\ \ If\ we\ find}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00938}00938\ \ \ \ \ \ \ \textcolor{comment}{//\ another\ router\ on\ any\ of\ our\ bridged\ links,\ we\ are\ a\ transit\ network.}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00939}00939\ \ \ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00940}00940\ \ \ \ \ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_router_a9c480fca2799ed5e445820561087500e}{ClearBridgesVisited}}\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00941}00941\ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\mbox{\hyperlink{classns3_1_1_d_g_r_router_ad1f4d3739e9972e6126b4f3c61b48cc3}{AnotherRouterOnLink}}\ (ndTemp))}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00942}00942\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00943}00943\ \ \ \ \ \ \ \ \ \ \ areTransitNetwork\ =\ \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00944}00944\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00945}00945\ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00946}00946\ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ If\ we're\ going\ to\ be\ a\ transit\ network,\ then\ we\ have\ got\ to\ elect}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00947}00947\ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ a\ designated\ router\ for\ the\ whole\ bridge.\ \ This\ means\ finding\ the}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00948}00948\ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ router\ with\ the\ lowest\ IP\ address\ on\ the\ whole\ bridge.\ \ We\ ask\ }}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00949}00949\ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ for\ the\ lowest\ address\ on\ each\ segment\ and\ pick\ the\ lowest\ of\ them}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00950}00950\ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ all.}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00951}00951\ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00952}00952\ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_router_a9c480fca2799ed5e445820561087500e}{ClearBridgesVisited}}\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00953}00953\ \ \ \ \ \ \ \ \ \ \ Ipv4Address\ desigRtrTemp\ =\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_a4878eacca3b0a943b4e7e49d25dd8e1b}{FindDesignatedRouterForLink}}\ (ndTemp);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00954}00954\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00955}00955\ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00956}00956\ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Let's\ double-\/check\ that\ any\ designated\ router\ we\ find\ out\ on\ our}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00957}00957\ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ network\ is\ really\ on\ our\ network.}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00958}00958\ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00959}00959\ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (desigRtrTemp\ !=\ \textcolor{stringliteral}{"{}255.255.255.255"{}})}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00960}00960\ \ \ \ \ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00961}00961\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Ipv4Address\ networkHere\ =\ addrLocal.CombineMask\ (maskLocal);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00962}00962\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Ipv4Address\ networkThere\ =\ desigRtrTemp.CombineMask\ (maskLocal);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00963}00963\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ NS\_ABORT\_MSG\_UNLESS\ (networkHere\ ==\ networkThere,\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00964}00964\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}DGRRouter::ProcessSingleBroadcastLink():\ Network\ number\ confusion\ ("{}}\ <<}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00965}00965\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ addrLocal\ <<\ \textcolor{stringliteral}{"{}/"{}}\ <<\ maskLocal.GetPrefixLength\ ()\ <<\ \textcolor{stringliteral}{"{},\ "{}}\ <<}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00966}00966\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ desigRtrTemp\ <<\ \textcolor{stringliteral}{"{}/"{}}\ <<\ maskLocal.GetPrefixLength\ ()\ <<\ \textcolor{stringliteral}{"{})"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00967}00967\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00968}00968\ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (desigRtrTemp\ <\ desigRtr)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00969}00969\ \ \ \ \ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00970}00970\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ desigRtr\ =\ desigRtrTemp;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00971}00971\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00972}00972\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00973}00973\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00974}00974\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00975}00975\ \ \ \textcolor{comment}{//\ That's\ all\ the\ information\ we\ need\ to\ put\ it\ all\ together,\ just\ like\ we\ did}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00976}00976\ \ \ \textcolor{comment}{//\ in\ the\ case\ of\ a\ single\ broadcast\ link.}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00977}00977\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00978}00978\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00979}00979\ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record}{DGRRoutingLinkRecord}}\ *plr\ =\ \textcolor{keyword}{new}\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record}{DGRRoutingLinkRecord}};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00980}00980\ \ \ NS\_ABORT\_MSG\_IF\ (plr\ ==\ 0,\ \textcolor{stringliteral}{"{}DGRRouter::ProcessBridgedBroadcastLink():\ Can't\ alloc\ link\ record"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00981}00981\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00982}00982\ \ \ \textcolor{keywordflow}{if}\ (areTransitNetwork\ ==\ \textcolor{keyword}{false})}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00983}00983\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00984}00984\ \ \ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00985}00985\ \ \ \ \ \ \ \textcolor{comment}{//\ This\ is\ a\ net\ device\ connected\ to\ a\ bridge\ of\ stub\ networks}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00986}00986\ \ \ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00987}00987\ \ \ \ \ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}Router-\/LSA\ Stub\ Network"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00988}00988\ \ \ \ \ \ \ plr-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_aacc16a8566cd389fd974cbeb8dde6ddd}{SetLinkType}}\ (\mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_a93b89b9f89407a39712186911ad12a4ba31c95bb0542fb4fab6cb056f88eea561}{DGRRoutingLinkRecord::StubNetwork}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00989}00989\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00990}00990\ \ \ \ \ \ \ \textcolor{comment}{//\ }}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00991}00991\ \ \ \ \ \ \ \textcolor{comment}{//\ According\ to\ OSPF,\ the\ Link\ ID\ is\ the\ IP\ network\ number\ of\ }}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00992}00992\ \ \ \ \ \ \ \textcolor{comment}{//\ the\ attached\ network.}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00993}00993\ \ \ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00994}00994\ \ \ \ \ \ \ plr-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_a203541f10ca13f9cfb1987fbbff4416b}{SetLinkId}}\ (addrLocal.CombineMask\ (maskLocal));}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00995}00995\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00996}00996\ \ \ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00997}00997\ \ \ \ \ \ \ \textcolor{comment}{//\ and\ the\ Link\ Data\ is\ the\ network\ mask;\ converted\ to\ Ipv4Address}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00998}00998\ \ \ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l00999}00999\ \ \ \ \ \ \ Ipv4Address\ maskLocalAddr;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01000}01000\ \ \ \ \ \ \ maskLocalAddr.Set\ (maskLocal.Get\ ());}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01001}01001\ \ \ \ \ \ \ plr-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_a06083e776955f21fe1fd4e4927cf0b24}{SetLinkData}}\ (maskLocalAddr);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01002}01002\ \ \ \ \ \ \ plr-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_ac6b9632b024b3799a25209f1392c1ab8}{SetMetric}}\ (metricLocal);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01003}01003\ \ \ \ \ \ \ pLSA-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a4b21b880eb8b7b733039d0dfaa8b48a4}{AddLinkRecord}}\ (plr);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01004}01004\ \ \ \ \ \ \ plr\ =\ 0;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01005}01005\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01006}01006\ \ \ \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01007}01007\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01008}01008\ \ \ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01009}01009\ \ \ \ \ \ \ \textcolor{comment}{//\ We\ have\ multiple\ routers\ on\ a\ bridged\ broadcast\ interface,\ so\ this\ is}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01010}01010\ \ \ \ \ \ \ \textcolor{comment}{//\ a\ transit\ network.}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01011}01011\ \ \ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01012}01012\ \ \ \ \ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}Router-\/LSA\ Transit\ Network"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01013}01013\ \ \ \ \ \ \ plr-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_aacc16a8566cd389fd974cbeb8dde6ddd}{SetLinkType}}\ (\mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_a93b89b9f89407a39712186911ad12a4baa0b0a272a289d2f1fcafdfedcde669b7}{DGRRoutingLinkRecord::TransitNetwork}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01014}01014\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01015}01015\ \ \ \ \ \ \ \textcolor{comment}{//\ }}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01016}01016\ \ \ \ \ \ \ \textcolor{comment}{//\ By\ definition,\ the\ router\ with\ the\ lowest\ IP\ address\ is\ the}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01017}01017\ \ \ \ \ \ \ \textcolor{comment}{//\ designated\ router\ for\ the\ network.\ \ OSPF\ says\ that\ the\ Link\ ID}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01018}01018\ \ \ \ \ \ \ \textcolor{comment}{//\ gets\ the\ IP\ interface\ address\ of\ the\ designated\ router\ in\ this\ }}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01019}01019\ \ \ \ \ \ \ \textcolor{comment}{//\ case.}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01020}01020\ \ \ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01021}01021\ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (desigRtr\ ==\ addrLocal)\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01022}01022\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01023}01023\ \ \ \ \ \ \ \ \ \ \ c.Add\ (nd);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01024}01024\ \ \ \ \ \ \ \ \ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}Node\ "{}}\ <<\ node-\/>GetId\ ()\ <<\ \textcolor{stringliteral}{"{}\ elected\ a\ designated\ router"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01025}01025\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01026}01026\ \ \ \ \ \ \ plr-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_a203541f10ca13f9cfb1987fbbff4416b}{SetLinkId}}\ (desigRtr);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01027}01027\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01028}01028\ \ \ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01029}01029\ \ \ \ \ \ \ \textcolor{comment}{//\ OSPF\ says\ that\ the\ Link\ Data\ is\ this\ router's\ own\ IP\ address.}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01030}01030\ \ \ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01031}01031\ \ \ \ \ \ \ plr-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_a06083e776955f21fe1fd4e4927cf0b24}{SetLinkData}}\ (addrLocal);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01032}01032\ \ \ \ \ \ \ plr-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_ac6b9632b024b3799a25209f1392c1ab8}{SetMetric}}\ (metricLocal);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01033}01033\ \ \ \ \ \ \ pLSA-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a4b21b880eb8b7b733039d0dfaa8b48a4}{AddLinkRecord}}\ (plr);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01034}01034\ \ \ \ \ \ \ plr\ =\ 0;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01035}01035\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01036}01036\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01037}01037\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01038}01038\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01039}01039\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01040}\mbox{\hyperlink{classns3_1_1_d_g_r_router_aac014913150c42a93cecbc6a9daf7552}{01040}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_aac014913150c42a93cecbc6a9daf7552}{DGRRouter::ProcessPointToPointLink}}\ (Ptr<NetDevice>\ ndLocal,\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a}{DGRRoutingLSA}}\ *pLSA)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01041}01041\ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01042}01042\ \ \ NS\_LOG\_FUNCTION\ (\textcolor{keyword}{this}\ <<\ ndLocal\ <<\ pLSA);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01043}01043\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01044}01044\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01045}01045\ \ \ \textcolor{comment}{//\ We\ have\ some\ preliminaries\ to\ do\ to\ get\ enough\ information\ to\ proceed.}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01046}01046\ \ \ \textcolor{comment}{//\ This\ information\ we\ need\ comes\ from\ the\ internet\ stack,\ so\ notice\ that}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01047}01047\ \ \ \textcolor{comment}{//\ there\ is\ an\ implied\ assumption\ that\ global\ routing\ is\ only\ going\ to\ }}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01048}01048\ \ \ \textcolor{comment}{//\ work\ with\ devices\ attached\ to\ the\ internet\ stack\ (have\ an\ ipv4\ interface}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01049}01049\ \ \ \textcolor{comment}{//\ associated\ to\ them.}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01050}01050\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01051}01051\ \ \ Ptr<Node>\ nodeLocal\ =\ ndLocal-\/>GetNode\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01052}01052\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01053}01053\ \ \ Ptr<Ipv4>\ ipv4Local\ =\ nodeLocal-\/>GetObject<Ipv4>\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01054}01054\ \ \ NS\_ABORT\_MSG\_UNLESS\ (ipv4Local,\ \textcolor{stringliteral}{"{}DGRRouter::ProcessPointToPointLink\ ():\ GetObject\ for\ <Ipv4>\ interface\ failed"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01055}01055\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01056}01056\ \ \ uint32\_t\ interfaceLocal\ =\ ipv4Local-\/>GetNInterfaces\ ()\ +\ 1;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01057}01057\ \ \ \textcolor{keywordtype}{bool}\ rc\ =\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_a817add200a30892091534c2d42fa43e5}{FindInterfaceForDevice}}\ (nodeLocal,\ ndLocal,\ interfaceLocal);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01058}01058\ \ \ NS\_ABORT\_MSG\_IF\ (rc\ ==\ \textcolor{keyword}{false},\ \textcolor{stringliteral}{"{}DGRRouter::ProcessPointToPointLink\ ():\ No\ interface\ index\ associated\ with\ device"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01059}01059\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01060}01060\ \ \ \textcolor{keywordflow}{if}\ (ipv4Local-\/>GetNAddresses\ (interfaceLocal)\ >\ 1)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01061}01061\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01062}01062\ \ \ \ \ \ \ NS\_LOG\_WARN\ (\textcolor{stringliteral}{"{}Warning,\ interface\ has\ multiple\ IP\ addresses;\ using\ only\ the\ primary\ one"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01063}01063\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01064}01064\ \ \ Ipv4Address\ addrLocal\ =\ ipv4Local-\/>GetAddress\ (interfaceLocal,\ 0).GetLocal\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01065}01065\ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}Working\ with\ local\ address\ "{}}\ <<\ addrLocal);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01066}01066\ \ \ uint16\_t\ metricLocal\ =\ ipv4Local-\/>GetMetric\ (interfaceLocal);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01067}01067\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01068}01068\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01069}01069\ \ \ \textcolor{comment}{//\ Now,\ we're\ going\ to\ walk\ over\ to\ the\ remote\ net\ device\ on\ the\ other\ end\ of\ }}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01070}01070\ \ \ \textcolor{comment}{//\ the\ point-\/to-\/point\ channel\ we\ know\ we\ have.\ \ This\ is\ where\ our\ adjacent\ }}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01071}01071\ \ \ \textcolor{comment}{//\ router\ (to\ use\ OSPF\ lingo)\ is\ running.}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01072}01072\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01073}01073\ \ \ Ptr<Channel>\ ch\ =\ ndLocal-\/>GetChannel\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01074}01074\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01075}01075\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01076}01076\ \ \ \textcolor{comment}{//\ Get\ the\ net\ device\ on\ the\ other\ side\ of\ the\ point-\/to-\/point\ channel.}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01077}01077\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01078}01078\ \ \ Ptr<NetDevice>\ ndRemote\ =\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_adc8946ca6068b51f7de5935696047a94}{GetAdjacent}}\ (ndLocal,\ ch);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01079}01079\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01080}01080\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01081}01081\ \ \ \textcolor{comment}{//\ The\ adjacent\ net\ device\ is\ aggregated\ to\ a\ node.\ \ We\ need\ to\ ask\ that\ net\ }}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01082}01082\ \ \ \textcolor{comment}{//\ device\ for\ its\ node,\ then\ ask\ that\ node\ for\ its\ Ipv4\ interface.\ \ Note\ a}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01083}01083\ \ \ \textcolor{comment}{//\ requirement\ that\ nodes\ on\ either\ side\ of\ a\ point-\/to-\/point\ link\ must\ have\ }}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01084}01084\ \ \ \textcolor{comment}{//\ internet\ stacks;\ and\ an\ assumption\ that\ point-\/to-\/point\ links\ are\ incompatible\ }}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01085}01085\ \ \ \textcolor{comment}{//\ with\ bridging.}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01086}01086\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01087}01087\ \ \ Ptr<Node>\ nodeRemote\ =\ ndRemote-\/>GetNode\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01088}01088\ \ \ Ptr<Ipv4>\ ipv4Remote\ =\ nodeRemote-\/>GetObject<Ipv4>\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01089}01089\ \ \ NS\_ABORT\_MSG\_UNLESS\ (ipv4Remote,\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01090}01090\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}DGRRouter::ProcessPointToPointLink():\ GetObject\ for\ remote\ <Ipv4>\ failed"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01091}01091\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01092}01092\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01093}01093\ \ \ \textcolor{comment}{//\ Further\ note\ the\ requirement\ that\ nodes\ on\ either\ side\ of\ a\ point-\/to-\/point\ }}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01094}01094\ \ \ \textcolor{comment}{//\ link\ must\ participate\ in\ global\ routing\ and\ therefore\ have\ a\ DGRRouter}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01095}01095\ \ \ \textcolor{comment}{//\ interface\ aggregated.}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01096}01096\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01097}01097\ \ \ Ptr<DGRRouter>\ rtrRemote\ =\ nodeRemote-\/>GetObject<\mbox{\hyperlink{classns3_1_1_d_g_r_router}{DGRRouter}}>\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01098}01098\ \ \ \textcolor{keywordflow}{if}\ (!rtrRemote)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01099}01099\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01100}01100\ \ \ \ \ \ \ \textcolor{comment}{//\ This\ case\ is\ possible\ if\ the\ remote\ does\ not\ participate\ in\ global\ routing}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01101}01101\ \ \ \ \ \ \ \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01102}01102\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01103}01103\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01104}01104\ \ \ \textcolor{comment}{//\ We're\ going\ to\ need\ the\ remote\ router\ ID,\ so\ we\ might\ as\ well\ get\ it\ now.}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01105}01105\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01106}01106\ \ \ Ipv4Address\ rtrIdRemote\ =\ rtrRemote-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_router_ad8375eec1264922d460ba8a5978f4ace}{GetRouterId}}\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01107}01107\ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}Working\ with\ remote\ router\ "{}}\ <<\ rtrIdRemote);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01108}01108\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01109}01109\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01110}01110\ \ \ \textcolor{comment}{//\ Now,\ just\ like\ we\ did\ above,\ we\ need\ to\ get\ the\ IP\ interface\ index\ for\ the\ }}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01111}01111\ \ \ \textcolor{comment}{//\ net\ device\ on\ the\ other\ end\ of\ the\ point-\/to-\/point\ channel.}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01112}01112\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01113}01113\ \ \ uint32\_t\ interfaceRemote\ =\ ipv4Remote-\/>GetNInterfaces\ ()\ +\ 1;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01114}01114\ \ \ rc\ =\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_a817add200a30892091534c2d42fa43e5}{FindInterfaceForDevice}}\ (nodeRemote,\ ndRemote,\ interfaceRemote);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01115}01115\ \ \ NS\_ABORT\_MSG\_IF\ (rc\ ==\ \textcolor{keyword}{false},\ \textcolor{stringliteral}{"{}DGRRouter::ProcessPointToPointLinks():\ No\ interface\ index\ associated\ with\ remote\ device"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01116}01116\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01117}01117\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01118}01118\ \ \ \textcolor{comment}{//\ Now\ that\ we\ have\ the\ Ipv4\ interface,\ we\ can\ get\ the\ (remote)\ address\ and}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01119}01119\ \ \ \textcolor{comment}{//\ mask\ we\ need.}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01120}01120\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01121}01121\ \ \ \textcolor{keywordflow}{if}\ (ipv4Remote-\/>GetNAddresses\ (interfaceRemote)\ >\ 1)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01122}01122\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01123}01123\ \ \ \ \ \ \ NS\_LOG\_WARN\ (\textcolor{stringliteral}{"{}Warning,\ interface\ has\ multiple\ IP\ addresses;\ using\ only\ the\ primary\ one"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01124}01124\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01125}01125\ \ \ Ipv4Address\ addrRemote\ =\ ipv4Remote-\/>GetAddress\ (interfaceRemote,\ 0).GetLocal\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01126}01126\ \ \ Ipv4Mask\ maskRemote\ =\ ipv4Remote-\/>GetAddress\ (interfaceRemote,\ 0).GetMask\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01127}01127\ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}Working\ with\ remote\ address\ "{}}\ <<\ addrRemote);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01128}01128\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01129}01129\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01130}01130\ \ \ \textcolor{comment}{//\ Now\ we\ can\ fill\ out\ the\ link\ records\ for\ this\ link.\ \ There\ are\ always\ two}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01131}01131\ \ \ \textcolor{comment}{//\ link\ records;\ the\ first\ is\ a\ point-\/to-\/point\ record\ describing\ the\ link\ and}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01132}01132\ \ \ \textcolor{comment}{//\ the\ second\ is\ a\ stub\ network\ record\ with\ the\ network\ number.}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01133}01133\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01134}01134\ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record}{DGRRoutingLinkRecord}}\ *plr;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01135}01135\ \ \ \textcolor{keywordflow}{if}\ (ipv4Remote-\/>IsUp\ (interfaceRemote))}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01136}01136\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01137}01137\ \ \ \ \ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}Remote\ side\ interface\ "{}}\ <<\ interfaceRemote\ <<\ \textcolor{stringliteral}{"{}\ is\ up-\/-\/\ add\ a\ type\ 1\ link"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01138}01138\ \ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01139}01139\ \ \ \ \ \ \ plr\ \ =\ \textcolor{keyword}{new}\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record}{DGRRoutingLinkRecord}};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01140}01140\ \ \ \ \ \ \ NS\_ABORT\_MSG\_IF\ (plr\ ==\ 0,\ \textcolor{stringliteral}{"{}DGRRouter::ProcessPointToPointLink():\ Can't\ alloc\ link\ record"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01141}01141\ \ \ \ \ \ \ plr-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_aacc16a8566cd389fd974cbeb8dde6ddd}{SetLinkType}}\ (\mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_a93b89b9f89407a39712186911ad12a4bac9c0a2d3da9eb9fdafee93e52a498c84}{DGRRoutingLinkRecord::PointToPoint}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01142}01142\ \ \ \ \ \ \ plr-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_a203541f10ca13f9cfb1987fbbff4416b}{SetLinkId}}\ (rtrIdRemote);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01143}01143\ \ \ \ \ \ \ plr-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_a06083e776955f21fe1fd4e4927cf0b24}{SetLinkData}}\ (addrLocal);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01144}01144\ \ \ \ \ \ \ plr-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_ac6b9632b024b3799a25209f1392c1ab8}{SetMetric}}\ (metricLocal);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01145}01145\ \ \ \ \ \ \ pLSA-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a4b21b880eb8b7b733039d0dfaa8b48a4}{AddLinkRecord}}\ (plr);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01146}01146\ \ \ \ \ \ \ plr\ =\ 0;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01147}01147\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01148}01148\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01149}01149\ \ \ \textcolor{comment}{//\ Regardless\ of\ state\ of\ peer,\ add\ a\ type\ 3\ link\ (RFC\ 2328:\ 12.4.1.1)}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01150}01150\ \ \ plr\ =\ \textcolor{keyword}{new}\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record}{DGRRoutingLinkRecord}};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01151}01151\ \ \ NS\_ABORT\_MSG\_IF\ (plr\ ==\ 0,\ \textcolor{stringliteral}{"{}DGRRouter::ProcessPointToPointLink():\ Can't\ alloc\ link\ record"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01152}01152\ \ \ plr-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_aacc16a8566cd389fd974cbeb8dde6ddd}{SetLinkType}}\ (\mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_a93b89b9f89407a39712186911ad12a4ba31c95bb0542fb4fab6cb056f88eea561}{DGRRoutingLinkRecord::StubNetwork}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01153}01153\ \ \ plr-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_a203541f10ca13f9cfb1987fbbff4416b}{SetLinkId}}\ (addrRemote);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01154}01154\ \ \ plr-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_a06083e776955f21fe1fd4e4927cf0b24}{SetLinkData}}\ (Ipv4Address\ (maskRemote.Get\ ()));\ \ \textcolor{comment}{//\ Frown}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01155}01155\ \ \ plr-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_link_record_ac6b9632b024b3799a25209f1392c1ab8}{SetMetric}}\ (metricLocal);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01156}01156\ \ \ pLSA-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a4b21b880eb8b7b733039d0dfaa8b48a4}{AddLinkRecord}}\ (plr);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01157}01157\ \ \ plr\ =\ 0;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01158}01158\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01159}01159\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01160}01160\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01161}\mbox{\hyperlink{classns3_1_1_d_g_r_router_a045a362fddd31a11a9c777bb64c889f7}{01161}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_a045a362fddd31a11a9c777bb64c889f7}{DGRRouter::BuildNetworkLSAs}}\ (NetDeviceContainer\ c)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01162}01162\ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01163}01163\ \ \ NS\_LOG\_FUNCTION\ (\textcolor{keyword}{this}\ <<\ \&c);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01164}01164\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01165}01165\ \ \ uint32\_t\ nDesignatedRouters\ =\ c.GetN\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01166}01166\ \ \ NS\_LOG\_DEBUG\ (\textcolor{stringliteral}{"{}Number\ of\ designated\ routers:\ "{}}\ <<\ nDesignatedRouters);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01167}01167\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01168}01168\ \ \ \textcolor{keywordflow}{for}\ (uint32\_t\ \mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}}\ =\ 0;\ \mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}}\ <\ nDesignatedRouters;\ ++\mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}})}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01169}01169\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01170}01170\ \ \ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01171}01171\ \ \ \ \ \ \ \textcolor{comment}{//\ Build\ one\ NetworkLSA\ for\ each\ net\ device\ talking\ to\ a\ network\ that\ we\ are\ the\ }}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01172}01172\ \ \ \ \ \ \ \textcolor{comment}{//\ designated\ router\ for.\ \ These\ devices\ are\ in\ the\ provided\ container.}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01173}01173\ \ \ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01174}01174\ \ \ \ \ \ \ Ptr<NetDevice>\ ndLocal\ =\ c.Get\ (\mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01175}01175\ \ \ \ \ \ \ Ptr<Node>\ node\ =\ ndLocal-\/>GetNode\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01176}01176\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01177}01177\ \ \ \ \ \ \ Ptr<Ipv4>\ ipv4Local\ =\ node-\/>GetObject<Ipv4>\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01178}01178\ \ \ \ \ \ \ NS\_ABORT\_MSG\_UNLESS\ (ipv4Local,\ \textcolor{stringliteral}{"{}DGRRouter::ProcessPointToPointLink\ ():\ GetObject\ for\ <Ipv4>\ interface\ failed"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01179}01179\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01180}01180\ \ \ \ \ \ \ uint32\_t\ interfaceLocal\ =\ ipv4Local-\/>GetNInterfaces\ ()\ +\ 1;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01181}01181\ \ \ \ \ \ \ \textcolor{keywordtype}{bool}\ rc\ =\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_a817add200a30892091534c2d42fa43e5}{FindInterfaceForDevice}}\ (node,\ ndLocal,\ interfaceLocal);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01182}01182\ \ \ \ \ \ \ NS\_ABORT\_MSG\_IF\ (rc\ ==\ \textcolor{keyword}{false},\ \textcolor{stringliteral}{"{}DGRRouter::BuildNetworkLSAs\ ():\ No\ interface\ index\ associated\ with\ device"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01183}01183\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01184}01184\ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (ipv4Local-\/>GetNAddresses\ (interfaceLocal)\ >\ 1)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01185}01185\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01186}01186\ \ \ \ \ \ \ \ \ \ \ NS\_LOG\_WARN\ (\textcolor{stringliteral}{"{}Warning,\ interface\ has\ multiple\ IP\ addresses;\ using\ only\ the\ primary\ one"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01187}01187\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01188}01188\ \ \ \ \ \ \ Ipv4Address\ addrLocal\ =\ ipv4Local-\/>GetAddress\ (interfaceLocal,\ 0).GetLocal\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01189}01189\ \ \ \ \ \ \ Ipv4Mask\ maskLocal\ =\ ipv4Local-\/>GetAddress\ (interfaceLocal,\ 0).GetMask\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01190}01190\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01191}01191\ \ \ \ \ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a}{DGRRoutingLSA}}\ *pLSA\ =\ \textcolor{keyword}{new}\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a}{DGRRoutingLSA}};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01192}01192\ \ \ \ \ \ \ NS\_ABORT\_MSG\_IF\ (pLSA\ ==\ 0,\ \textcolor{stringliteral}{"{}DGRRouter::BuildNetworkLSAs():\ Can't\ alloc\ link\ record"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01193}01193\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01194}01194\ \ \ \ \ \ \ pLSA-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a898720f0e7c926c4ecd2ca89d09363dd}{SetLSType}}\ (\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a38d676a01a677ff003f198d454cf0694a5d51f5653b9ddf1d8bf640932068cb85}{DGRRoutingLSA::NetworkLSA}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01195}01195\ \ \ \ \ \ \ pLSA-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a382594771f20561edde6e6b53d3bd982}{SetLinkStateId}}\ (addrLocal);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01196}01196\ \ \ \ \ \ \ pLSA-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a5f36eb9409d5d6532b9bd267e8d90f61}{SetAdvertisingRouter}}\ (\mbox{\hyperlink{classns3_1_1_d_g_r_router_ad5a4a0b95c697c5121ee5096dfb1da61}{m\_routerId}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01197}01197\ \ \ \ \ \ \ pLSA-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a1d60ee05ffc0dd4d434fb12917f6c83e}{SetNetworkLSANetworkMask}}\ (maskLocal);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01198}01198\ \ \ \ \ \ \ pLSA-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a497453d1271c0020968487ec8ead99c5}{SetStatus}}\ (\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a2d6cf227cde572e9c99d273a0e0fa5f7ac563232b34162339268c7804c93765ad}{DGRRoutingLSA::LSA\_SPF\_NOT\_EXPLORED}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01199}01199\ \ \ \ \ \ \ pLSA-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a5fb6e248545fbd3d50b34429e4780746}{SetNode}}\ (node);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01200}01200\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01201}01201\ \ \ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01202}01202\ \ \ \ \ \ \ \textcolor{comment}{//\ Build\ a\ list\ of\ AttachedRouters\ by\ walking\ the\ devices\ in\ the\ channel}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01203}01203\ \ \ \ \ \ \ \textcolor{comment}{//\ and,\ if\ we\ find\ a\ node\ with\ a\ DGRRouter\ interface\ and\ an\ IPv4\ }}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01204}01204\ \ \ \ \ \ \ \textcolor{comment}{//\ interface\ associated\ with\ that\ device,\ we\ call\ it\ an\ attached\ router.}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01205}01205\ \ \ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01206}01206\ \ \ \ \ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_router_a9c480fca2799ed5e445820561087500e}{ClearBridgesVisited}}\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01207}01207\ \ \ \ \ \ \ Ptr<Channel>\ ch\ =\ ndLocal-\/>GetChannel\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01208}01208\ \ \ \ \ \ \ std::size\_t\ nDevices\ =\ ch-\/>GetNDevices\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01209}01209\ \ \ \ \ \ \ NS\_ASSERT\ (nDevices);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01210}01210\ \ \ \ \ \ \ NetDeviceContainer\ deviceList\ =\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_a82bb020047d97bca36f66ab9c8eeb20a}{FindAllNonBridgedDevicesOnLink}}\ (ch);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01211}01211\ \ \ \ \ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}Found\ "{}}\ <<\ deviceList.GetN\ ()\ <<\ \textcolor{stringliteral}{"{}\ non-\/bridged\ devices\ on\ channel"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01212}01212\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01213}01213\ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (uint32\_t\ \mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}}\ =\ 0;\ \mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}}\ <\ deviceList.GetN\ ();\ \mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}}++)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01214}01214\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01215}01215\ \ \ \ \ \ \ \ \ \ \ Ptr<NetDevice>\ tempNd\ =\ deviceList.Get\ (\mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01216}01216\ \ \ \ \ \ \ \ \ \ \ NS\_ASSERT\ (tempNd);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01217}01217\ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (tempNd\ ==\ ndLocal)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01218}01218\ \ \ \ \ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01219}01219\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}Adding\ "{}}\ <<\ addrLocal\ <<\ \textcolor{stringliteral}{"{}\ to\ Network\ LSA"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01220}01220\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ pLSA-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a945e5e3081dc4463d6335cf40d81b192}{AddAttachedRouter}}\ (addrLocal);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01221}01221\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01222}01222\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01223}01223\ \ \ \ \ \ \ \ \ \ \ Ptr<Node>\ tempNode\ =\ tempNd-\/>GetNode\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01224}01224\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01225}01225\ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Does\ the\ node\ in\ question\ have\ a\ DGRRouter\ interface?\ \ If\ not\ it\ can}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01226}01226\ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ hardly\ be\ considered\ an\ attached\ router.}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01227}01227\ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01228}01228\ \ \ \ \ \ \ \ \ \ \ Ptr<DGRRouter>\ rtr\ =\ tempNode-\/>GetObject<\mbox{\hyperlink{classns3_1_1_d_g_r_router}{DGRRouter}}>\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01229}01229\ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!rtr)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01230}01230\ \ \ \ \ \ \ \ \ \ \ \ \ \{\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01231}01231\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}Node\ "{}}\ <<\ tempNode-\/>GetId\ ()\ <<\ \textcolor{stringliteral}{"{}\ does\ not\ have\ DGRRouter\ interface-\/-\/skipping"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01232}01232\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01233}01233\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01234}01234\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01235}01235\ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01236}01236\ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Does\ the\ attached\ node\ have\ an\ ipv4\ interface\ for\ the\ device\ we're\ probing?}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01237}01237\ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ If\ not,\ it\ can't\ play\ router.}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01238}01238\ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01239}01239\ \ \ \ \ \ \ \ \ \ \ uint32\_t\ tempInterface\ =\ 0;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01240}01240\ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\mbox{\hyperlink{classns3_1_1_d_g_r_router_a817add200a30892091534c2d42fa43e5}{FindInterfaceForDevice}}\ (tempNode,\ tempNd,\ tempInterface))}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01241}01241\ \ \ \ \ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01242}01242\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Ptr<Ipv4>\ tempIpv4\ =\ tempNode-\/>GetObject<Ipv4>\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01243}01243\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ NS\_ASSERT\ (tempIpv4);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01244}01244\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!tempIpv4-\/>IsUp\ (tempInterface))}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01245}01245\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01246}01246\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}Remote\ side\ interface\ "{}}\ <<\ tempInterface\ <<\ \textcolor{stringliteral}{"{}\ not\ up"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01247}01247\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01248}01248\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{else}\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01249}01249\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01250}01250\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (tempIpv4-\/>GetNAddresses\ (tempInterface)\ >\ 1)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01251}01251\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01252}01252\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ NS\_LOG\_WARN\ (\textcolor{stringliteral}{"{}Warning,\ interface\ has\ multiple\ IP\ addresses;\ using\ only\ the\ primary\ one"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01253}01253\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01254}01254\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Ipv4Address\ tempAddr\ =\ tempIpv4-\/>GetAddress\ (tempInterface,\ 0).GetLocal\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01255}01255\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}Adding\ "{}}\ <<\ tempAddr\ <<\ \textcolor{stringliteral}{"{}\ to\ Network\ LSA"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01256}01256\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ pLSA-\/>\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a945e5e3081dc4463d6335cf40d81b192}{AddAttachedRouter}}\ (tempAddr);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01257}01257\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01258}01258\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01259}01259\ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01260}01260\ \ \ \ \ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01261}01261\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}Node\ "{}}\ <<\ tempNode-\/>GetId\ ()\ <<\ \textcolor{stringliteral}{"{}\ device\ "{}}\ <<\ tempNd\ <<\ \textcolor{stringliteral}{"{}\ does\ not\ have\ IPv4\ interface;\ skipping"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01262}01262\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01263}01263\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01264}01264\ \ \ \ \ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_router_aa839f56748d61a63ad55c0db58ddd07f}{m\_LSAs}}.push\_back\ (pLSA);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01265}01265\ \ \ \ \ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}==========\ LSA\ for\ node\ "{}}\ <<\ node-\/>GetId\ ()\ <<\ \textcolor{stringliteral}{"{}\ =========="{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01266}01266\ \ \ \ \ \ \ NS\_LOG\_LOGIC\ (*pLSA);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01267}01267\ \ \ \ \ \ \ pLSA\ =\ 0;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01268}01268\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01269}01269\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01270}01270\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01271}01271\ NetDeviceContainer}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01272}\mbox{\hyperlink{classns3_1_1_d_g_r_router_a82bb020047d97bca36f66ab9c8eeb20a}{01272}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_a82bb020047d97bca36f66ab9c8eeb20a}{DGRRouter::FindAllNonBridgedDevicesOnLink}}\ (Ptr<Channel>\ ch)\textcolor{keyword}{\ const}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01273}01273\ \textcolor{keyword}{}\{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01274}01274\ \ \ NS\_LOG\_FUNCTION\ (\textcolor{keyword}{this}\ <<\ ch);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01275}01275\ \ \ NetDeviceContainer\ c;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01276}01276\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01277}01277\ \ \ \textcolor{keywordflow}{for}\ (std::size\_t\ \mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}}\ =\ 0;\ \mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}}\ <\ ch-\/>GetNDevices\ ();\ \mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}}++)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01278}01278\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01279}01279\ \ \ \ \ \ \ Ptr<NetDevice>\ nd\ =\ ch-\/>GetDevice\ (\mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01280}01280\ \ \ \ \ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}checking\ to\ see\ if\ the\ device\ "{}}\ <<\ nd\ <<\ \textcolor{stringliteral}{"{}\ is\ bridged"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01281}01281\ \ \ \ \ \ \ Ptr<BridgeNetDevice>\ bnd\ =\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_a53fdf9c96432439b34d091da6050890b}{NetDeviceIsBridged}}\ (nd);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01282}01282\ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (bnd\ \&\&\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_a12f7423d137d6716fc597ee947173c41}{BridgeHasAlreadyBeenVisited}}\ (bnd)\ ==\ \textcolor{keyword}{false})}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01283}01283\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01284}01284\ \ \ \ \ \ \ \ \ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}Device\ is\ bridged\ by\ BridgeNetDevice\ "{}}\ <<\ bnd\ <<\ \textcolor{stringliteral}{"{}\ with\ "{}}\ <<\ bnd-\/>GetNBridgePorts\ ()\ <<\ \textcolor{stringliteral}{"{}\ ports"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01285}01285\ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_router_ac62c957b71fbe4ce12586c380dbfceeb}{MarkBridgeAsVisited}}\ (bnd);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01286}01286\ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Find\ all\ channels\ bridged\ together,\ and\ recursively\ call}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01287}01287\ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ on\ all\ other\ channels}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01288}01288\ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (uint32\_t\ j\ =\ 0;\ j\ <\ bnd-\/>GetNBridgePorts\ ();\ j++)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01289}01289\ \ \ \ \ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01290}01290\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Ptr<NetDevice>\ bridgedDevice\ =\ bnd-\/>GetBridgePort\ (j);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01291}01291\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (bridgedDevice-\/>GetChannel\ ()\ ==\ ch)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01292}01292\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01293}01293\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}Skipping\ my\ own\ device/channel"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01294}01294\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01295}01295\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01296}01296\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}Calling\ on\ channel\ "{}}\ <<\ bridgedDevice-\/>GetChannel\ ());}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01297}01297\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ c.Add\ (\mbox{\hyperlink{classns3_1_1_d_g_r_router_a82bb020047d97bca36f66ab9c8eeb20a}{FindAllNonBridgedDevicesOnLink}}\ (bridgedDevice-\/>GetChannel\ ()));}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01298}01298\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01299}01299\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01300}01300\ \ \ \ \ \ \ \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01301}01301\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01302}01302\ \ \ \ \ \ \ \ \ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}Device\ is\ not\ bridged;\ adding"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01303}01303\ \ \ \ \ \ \ \ \ \ \ c.Add\ (nd);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01304}01304\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01305}01305\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01306}01306\ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}Found\ "{}}\ <<\ c.GetN\ ()\ <<\ \textcolor{stringliteral}{"{}\ devices"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01307}01307\ \ \ \textcolor{keywordflow}{return}\ c;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01308}01308\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01309}01309\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01310}01310\ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01311}01311\ \textcolor{comment}{//\ Given\ a\ local\ net\ device,\ we\ need\ to\ walk\ the\ channel\ to\ which\ the\ net\ device\ is}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01312}01312\ \textcolor{comment}{//\ attached\ and\ look\ for\ nodes\ with\ DGRRouter\ interfaces\ on\ them\ (one\ of\ them\ }}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01313}01313\ \textcolor{comment}{//\ will\ be\ us).\ \ Of\ these,\ the\ router\ with\ the\ lowest\ IP\ address\ on\ the\ net\ device\ }}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01314}01314\ \textcolor{comment}{//\ connecting\ to\ the\ channel\ becomes\ the\ designated\ router\ for\ the\ link.}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01315}01315\ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01316}01316\ Ipv4Address}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01317}\mbox{\hyperlink{classns3_1_1_d_g_r_router_a4878eacca3b0a943b4e7e49d25dd8e1b}{01317}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_a4878eacca3b0a943b4e7e49d25dd8e1b}{DGRRouter::FindDesignatedRouterForLink}}\ (Ptr<NetDevice>\ ndLocal)\textcolor{keyword}{\ const}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01318}01318\ \textcolor{keyword}{}\{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01319}01319\ \ \ NS\_LOG\_FUNCTION\ (\textcolor{keyword}{this}\ <<\ ndLocal);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01320}01320\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01321}01321\ \ \ Ptr<Channel>\ ch\ =\ ndLocal-\/>GetChannel\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01322}01322\ \ \ uint32\_t\ nDevices\ =\ ch-\/>GetNDevices\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01323}01323\ \ \ NS\_ASSERT\ (nDevices);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01324}01324\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01325}01325\ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}Looking\ for\ designated\ router\ off\ of\ net\ device\ "{}}\ <<\ ndLocal\ <<\ \textcolor{stringliteral}{"{}\ on\ node\ "{}}\ <<\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01326}01326\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ndLocal-\/>GetNode\ ()-\/>GetId\ ());}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01327}01327\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01328}01328\ \ \ Ipv4Address\ desigRtr\ (\textcolor{stringliteral}{"{}255.255.255.255"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01329}01329\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01330}01330\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01331}01331\ \ \ \textcolor{comment}{//\ Look\ through\ all\ of\ the\ devices\ on\ the\ channel\ to\ which\ the\ net\ device}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01332}01332\ \ \ \textcolor{comment}{//\ in\ question\ is\ attached.}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01333}01333\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01334}01334\ \ \ \textcolor{keywordflow}{for}\ (uint32\_t\ \mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}}\ =\ 0;\ \mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}}\ <\ nDevices;\ \mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}}++)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01335}01335\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01336}01336\ \ \ \ \ \ \ Ptr<NetDevice>\ ndOther\ =\ ch-\/>GetDevice\ (\mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01337}01337\ \ \ \ \ \ \ NS\_ASSERT\ (ndOther);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01338}01338\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01339}01339\ \ \ \ \ \ \ Ptr<Node>\ nodeOther\ =\ ndOther-\/>GetNode\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01340}01340\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01341}01341\ \ \ \ \ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}Examine\ channel\ device\ "{}}\ <<\ \mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}}\ <<\ \textcolor{stringliteral}{"{}\ on\ node\ "{}}\ <<\ nodeOther-\/>GetId\ ());}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01342}01342\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01343}01343\ \ \ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01344}01344\ \ \ \ \ \ \ \textcolor{comment}{//\ For\ all\ other\ net\ devices,\ we\ need\ to\ check\ and\ see\ if\ a\ router}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01345}01345\ \ \ \ \ \ \ \textcolor{comment}{//\ is\ present.\ \ If\ the\ net\ device\ on\ the\ other\ side\ is\ a\ bridged}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01346}01346\ \ \ \ \ \ \ \textcolor{comment}{//\ device,\ we\ need\ to\ consider\ all\ of\ the\ other\ devices\ on\ the\ }}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01347}01347\ \ \ \ \ \ \ \textcolor{comment}{//\ bridge\ as\ well\ (all\ of\ the\ bridge\ ports.}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01348}01348\ \ \ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01349}01349\ \ \ \ \ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}checking\ to\ see\ if\ the\ device\ is\ bridged"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01350}01350\ \ \ \ \ \ \ Ptr<BridgeNetDevice>\ bnd\ =\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_a53fdf9c96432439b34d091da6050890b}{NetDeviceIsBridged}}\ (ndOther);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01351}01351\ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (bnd)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01352}01352\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01353}01353\ \ \ \ \ \ \ \ \ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}Device\ is\ bridged\ by\ BridgeNetDevice\ "{}}\ <<\ bnd);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01354}01354\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01355}01355\ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01356}01356\ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ When\ enumerating\ a\ bridge,\ don't\ count\ the\ netdevice\ we\ came\ in\ on}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01357}01357\ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01358}01358\ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (ndLocal\ ==\ ndOther)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01359}01359\ \ \ \ \ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01360}01360\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}Skip\ -\/-\/\ it\ is\ where\ we\ came\ from."{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01361}01361\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01362}01362\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01363}01363\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01364}01364\ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01365}01365\ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ It\ is\ possible\ that\ the\ bridge\ net\ device\ is\ sitting\ under\ a}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01366}01366\ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ router,\ so\ we\ have\ to\ check\ for\ the\ presence\ of\ that\ router}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01367}01367\ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ before\ we\ run\ off\ and\ follow\ all\ the\ links}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01368}01368\ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01369}01369\ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ We\ require\ a\ designated\ router\ to\ have\ a\ DGRRouter\ interface\ and}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01370}01370\ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ an\ internet\ stack\ that\ includes\ the\ Ipv4\ interface.\ \ If\ it\ doesn't}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01371}01371\ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ it\ can't\ play\ router.}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01372}01372\ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01373}01373\ \ \ \ \ \ \ \ \ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}Checking\ for\ router\ on\ bridge\ net\ device\ "{}}\ <<\ bnd);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01374}01374\ \ \ \ \ \ \ \ \ \ \ Ptr<DGRRouter>\ rtr\ =\ nodeOther-\/>GetObject<\mbox{\hyperlink{classns3_1_1_d_g_r_router}{DGRRouter}}>\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01375}01375\ \ \ \ \ \ \ \ \ \ \ Ptr<Ipv4>\ ipv4\ =\ nodeOther-\/>GetObject<Ipv4>\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01376}01376\ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (rtr\ \&\&\ ipv4)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01377}01377\ \ \ \ \ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01378}01378\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Initialize\ to\ value\ out\ of\ bounds\ to\ silence\ compiler}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01379}01379\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ uint32\_t\ interfaceOther\ =\ ipv4-\/>GetNInterfaces\ ()\ +\ 1;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01380}01380\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\mbox{\hyperlink{classns3_1_1_d_g_r_router_a817add200a30892091534c2d42fa43e5}{FindInterfaceForDevice}}\ (nodeOther,\ bnd,\ interfaceOther))}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01381}01381\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01382}01382\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}Found\ router\ on\ bridge\ net\ device\ "{}}\ <<\ bnd);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01383}01383\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!ipv4-\/>IsUp\ (interfaceOther))}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01384}01384\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01385}01385\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}Remote\ side\ interface\ "{}}\ <<\ interfaceOther\ <<\ \textcolor{stringliteral}{"{}\ not\ up"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01386}01386\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01387}01387\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01388}01388\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (ipv4-\/>GetNAddresses\ (interfaceOther)\ >\ 1)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01389}01389\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01390}01390\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ NS\_LOG\_WARN\ (\textcolor{stringliteral}{"{}Warning,\ interface\ has\ multiple\ IP\ addresses;\ using\ only\ the\ primary\ one"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01391}01391\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01392}01392\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Ipv4Address\ addrOther\ =\ ipv4-\/>GetAddress\ (interfaceOther,\ 0).GetLocal\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01393}01393\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ desigRtr\ =\ addrOther\ <\ desigRtr\ ?\ addrOther\ :\ desigRtr;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01394}01394\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}designated\ router\ now\ "{}}\ <<\ desigRtr);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01395}01395\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01396}01396\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01397}01397\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01398}01398\ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ }}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01399}01399\ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Check\ if\ we\ have\ seen\ this\ bridge\ net\ device\ already\ while}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01400}01400\ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ recursively\ enumerating\ an\ L2\ broadcast\ domain.\ If\ it\ is\ new\ }}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01401}01401\ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ to\ us,\ go\ ahead\ and\ process\ it.\ If\ we\ have\ already\ processed\ it,}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01402}01402\ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ move\ to\ the\ next}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01403}01403\ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ }}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01404}01404\ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}(\mbox{\hyperlink{classns3_1_1_d_g_r_router_a12f7423d137d6716fc597ee947173c41}{BridgeHasAlreadyBeenVisited}}(bnd))}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01405}01405\ \ \ \ \ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01406}01406\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ NS\_ABORT\_MSG\ (\textcolor{stringliteral}{"{}ERROR:\ L2\ forwarding\ loop\ detected!"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01407}01407\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01408}01408\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01409}01409\ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_router_ac62c957b71fbe4ce12586c380dbfceeb}{MarkBridgeAsVisited}}(bnd);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01410}01410\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01411}01411\ \ \ \ \ \ \ \ \ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}Looking\ through\ bridge\ ports\ of\ bridge\ net\ device\ "{}}\ <<\ bnd);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01412}01412\ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (uint32\_t\ j\ =\ 0;\ j\ <\ bnd-\/>GetNBridgePorts\ ();\ ++j)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01413}01413\ \ \ \ \ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01414}01414\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Ptr<NetDevice>\ ndBridged\ =\ bnd-\/>GetBridgePort\ (j);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01415}01415\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}Examining\ bridge\ port\ "{}}\ <<\ j\ <<\ \textcolor{stringliteral}{"{}\ device\ "{}}\ <<\ ndBridged);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01416}01416\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (ndBridged\ ==\ ndOther)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01417}01417\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01418}01418\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}That\ bridge\ port\ is\ me,\ don't\ walk\ backward"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01419}01419\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01420}01420\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01421}01421\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01422}01422\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}Recursively\ looking\ for\ routers\ down\ bridge\ port\ "{}}\ <<\ ndBridged);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01423}01423\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Ipv4Address\ addrOther\ =\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_a4878eacca3b0a943b4e7e49d25dd8e1b}{FindDesignatedRouterForLink}}\ (ndBridged);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01424}01424\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ desigRtr\ =\ addrOther\ <\ desigRtr\ ?\ addrOther\ :\ desigRtr;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01425}01425\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}designated\ router\ now\ "{}}\ <<\ desigRtr);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01426}01426\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01427}01427\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01428}01428\ \ \ \ \ \ \ \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01429}01429\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01430}01430\ \ \ \ \ \ \ \ \ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}This\ device\ is\ not\ bridged"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01431}01431\ \ \ \ \ \ \ \ \ \ \ Ptr<Node>\ nodeOther\ =\ ndOther-\/>GetNode\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01432}01432\ \ \ \ \ \ \ \ \ \ \ NS\_ASSERT\ (nodeOther);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01433}01433\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01434}01434\ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01435}01435\ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ We\ require\ a\ designated\ router\ to\ have\ a\ DGRRouter\ interface\ and}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01436}01436\ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ an\ internet\ stack\ that\ includes\ the\ Ipv4\ interface.\ \ If\ it\ doesn't}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01437}01437\ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01438}01438\ \ \ \ \ \ \ \ \ \ \ Ptr<DGRRouter>\ rtr\ =\ nodeOther-\/>GetObject<\mbox{\hyperlink{classns3_1_1_d_g_r_router}{DGRRouter}}>\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01439}01439\ \ \ \ \ \ \ \ \ \ \ Ptr<Ipv4>\ ipv4\ =\ nodeOther-\/>GetObject<Ipv4>\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01440}01440\ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (rtr\ \&\&\ ipv4)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01441}01441\ \ \ \ \ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01442}01442\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Initialize\ to\ value\ out\ of\ bounds\ to\ silence\ compiler}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01443}01443\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ uint32\_t\ interfaceOther\ =\ ipv4-\/>GetNInterfaces\ ()\ +\ 1;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01444}01444\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\mbox{\hyperlink{classns3_1_1_d_g_r_router_a817add200a30892091534c2d42fa43e5}{FindInterfaceForDevice}}\ (nodeOther,\ ndOther,\ interfaceOther))}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01445}01445\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01446}01446\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!ipv4-\/>IsUp\ (interfaceOther))}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01447}01447\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01448}01448\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}Remote\ side\ interface\ "{}}\ <<\ interfaceOther\ <<\ \textcolor{stringliteral}{"{}\ not\ up"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01449}01449\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01450}01450\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01451}01451\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}Found\ router\ on\ net\ device\ "{}}\ <<\ ndOther);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01452}01452\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (ipv4-\/>GetNAddresses\ (interfaceOther)\ >\ 1)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01453}01453\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01454}01454\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ NS\_LOG\_WARN\ (\textcolor{stringliteral}{"{}Warning,\ interface\ has\ multiple\ IP\ addresses;\ using\ only\ the\ primary\ one"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01455}01455\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01456}01456\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Ipv4Address\ addrOther\ =\ ipv4-\/>GetAddress\ (interfaceOther,\ 0).GetLocal\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01457}01457\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ desigRtr\ =\ addrOther\ <\ desigRtr\ ?\ addrOther\ :\ desigRtr;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01458}01458\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}designated\ router\ now\ "{}}\ <<\ desigRtr);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01459}01459\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01460}01460\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01461}01461\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01462}01462\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01463}01463\ \ \ \textcolor{keywordflow}{return}\ desigRtr;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01464}01464\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01465}01465\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01466}01466\ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01467}01467\ \textcolor{comment}{//\ Given\ a\ node\ and\ an\ attached\ net\ device,\ take\ a\ look\ off\ in\ the\ channel\ to\ }}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01468}01468\ \textcolor{comment}{//\ which\ the\ net\ device\ is\ attached\ and\ look\ for\ a\ node\ on\ the\ other\ side}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01469}01469\ \textcolor{comment}{//\ that\ has\ a\ DGRRouter\ interface\ aggregated.\ \ Life\ gets\ more\ complicated}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01470}01470\ \textcolor{comment}{//\ when\ there\ is\ a\ bridged\ net\ device\ on\ the\ other\ side.}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01471}01471\ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01472}01472\ \textcolor{keywordtype}{bool}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01473}\mbox{\hyperlink{classns3_1_1_d_g_r_router_ad1f4d3739e9972e6126b4f3c61b48cc3}{01473}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_ad1f4d3739e9972e6126b4f3c61b48cc3}{DGRRouter::AnotherRouterOnLink}}\ (Ptr<NetDevice>\ nd)\textcolor{keyword}{\ const}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01474}01474\ \textcolor{keyword}{}\{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01475}01475\ \ \ NS\_LOG\_FUNCTION\ (\textcolor{keyword}{this}\ <<\ nd);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01476}01476\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01477}01477\ \ \ Ptr<Channel>\ ch\ =\ nd-\/>GetChannel\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01478}01478\ \ \ \textcolor{keywordflow}{if}\ (!ch)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01479}01479\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01480}01480\ \ \ \ \ \ \ \textcolor{comment}{//\ It\ may\ be\ that\ this\ net\ device\ is\ a\ stub\ device,\ without\ a\ channel}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01481}01481\ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01482}01482\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01483}01483\ \ \ uint32\_t\ nDevices\ =\ ch-\/>GetNDevices\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01484}01484\ \ \ NS\_ASSERT\ (nDevices);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01485}01485\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01486}01486\ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}Looking\ for\ routers\ off\ of\ net\ device\ "{}}\ <<\ nd\ <<\ \textcolor{stringliteral}{"{}\ on\ node\ "{}}\ <<\ nd-\/>GetNode\ ()-\/>GetId\ ());}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01487}01487\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01488}01488\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01489}01489\ \ \ \textcolor{comment}{//\ Look\ through\ all\ of\ the\ devices\ on\ the\ channel\ to\ which\ the\ net\ device}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01490}01490\ \ \ \textcolor{comment}{//\ in\ question\ is\ attached.}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01491}01491\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01492}01492\ \ \ \textcolor{keywordflow}{for}\ (uint32\_t\ \mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}}\ =\ 0;\ \mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}}\ <\ nDevices;\ \mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}}++)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01493}01493\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01494}01494\ \ \ \ \ \ \ Ptr<NetDevice>\ ndOther\ =\ ch-\/>GetDevice\ (\mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01495}01495\ \ \ \ \ \ \ NS\_ASSERT\ (ndOther);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01496}01496\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01497}01497\ \ \ \ \ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}Examine\ channel\ device\ "{}}\ <<\ \mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}}\ <<\ \textcolor{stringliteral}{"{}\ on\ node\ "{}}\ <<\ ndOther-\/>GetNode\ ()-\/>GetId\ ());}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01498}01498\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01499}01499\ \ \ \ \ \ \ \textcolor{comment}{//\ }}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01500}01500\ \ \ \ \ \ \ \textcolor{comment}{//\ Ignore\ the\ net\ device\ itself.}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01501}01501\ \ \ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01502}01502\ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (ndOther\ ==\ nd)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01503}01503\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01504}01504\ \ \ \ \ \ \ \ \ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}Myself,\ skip"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01505}01505\ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01506}01506\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01507}01507\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01508}01508\ \ \ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01509}01509\ \ \ \ \ \ \ \textcolor{comment}{//\ For\ all\ other\ net\ devices,\ we\ need\ to\ check\ and\ see\ if\ a\ router}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01510}01510\ \ \ \ \ \ \ \textcolor{comment}{//\ is\ present.\ \ If\ the\ net\ device\ on\ the\ other\ side\ is\ a\ bridged}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01511}01511\ \ \ \ \ \ \ \textcolor{comment}{//\ device,\ we\ need\ to\ consider\ all\ of\ the\ other\ devices\ on\ the\ }}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01512}01512\ \ \ \ \ \ \ \textcolor{comment}{//\ bridge.}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01513}01513\ \ \ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01514}01514\ \ \ \ \ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}checking\ to\ see\ if\ device\ is\ bridged"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01515}01515\ \ \ \ \ \ \ Ptr<BridgeNetDevice>\ bnd\ =\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_a53fdf9c96432439b34d091da6050890b}{NetDeviceIsBridged}}\ (ndOther);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01516}01516\ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (bnd)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01517}01517\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01518}01518\ \ \ \ \ \ \ \ \ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}Device\ is\ bridged\ by\ net\ device\ "{}}\ <<\ bnd);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01519}01519\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01520}01520\ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ }}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01521}01521\ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Check\ if\ we\ have\ seen\ this\ bridge\ net\ device\ already\ while}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01522}01522\ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ recursively\ enumerating\ an\ L2\ broadcast\ domain.\ If\ it\ is\ new\ }}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01523}01523\ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ to\ us,\ go\ ahead\ and\ process\ it.\ If\ we\ have\ already\ processed\ it,}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01524}01524\ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ move\ to\ the\ next}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01525}01525\ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ }}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01526}01526\ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}(\mbox{\hyperlink{classns3_1_1_d_g_r_router_a12f7423d137d6716fc597ee947173c41}{BridgeHasAlreadyBeenVisited}}(bnd))}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01527}01527\ \ \ \ \ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01528}01528\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ NS\_ABORT\_MSG\ (\textcolor{stringliteral}{"{}ERROR:\ L2\ forwarding\ loop\ detected!"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01529}01529\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01530}01530\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01531}01531\ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_router_ac62c957b71fbe4ce12586c380dbfceeb}{MarkBridgeAsVisited}}(bnd);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01532}01532\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01533}01533\ \ \ \ \ \ \ \ \ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}Looking\ through\ bridge\ ports\ of\ bridge\ net\ device\ "{}}\ <<\ bnd);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01534}01534\ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (uint32\_t\ j\ =\ 0;\ j\ <\ bnd-\/>GetNBridgePorts\ ();\ ++j)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01535}01535\ \ \ \ \ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01536}01536\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Ptr<NetDevice>\ ndBridged\ =\ bnd-\/>GetBridgePort\ (j);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01537}01537\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}Examining\ bridge\ port\ "{}}\ <<\ j\ <<\ \textcolor{stringliteral}{"{}\ device\ "{}}\ <<\ ndBridged);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01538}01538\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (ndBridged\ ==\ ndOther)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01539}01539\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01540}01540\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}That\ bridge\ port\ is\ me,\ skip"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01541}01541\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01542}01542\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01543}01543\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01544}01544\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}Recursively\ looking\ for\ routers\ on\ bridge\ port\ "{}}\ <<\ ndBridged);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01545}01545\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\mbox{\hyperlink{classns3_1_1_d_g_r_router_ad1f4d3739e9972e6126b4f3c61b48cc3}{AnotherRouterOnLink}}\ (ndBridged))}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01546}01546\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01547}01547\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}Found\ routers\ on\ bridge\ port,\ return\ true"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01548}01548\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01549}01549\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01550}01550\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01551}01551\ \ \ \ \ \ \ \ \ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}No\ routers\ on\ bridged\ net\ device,\ return\ false"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01552}01552\ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01553}01553\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01554}01554\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01555}01555\ \ \ \ \ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}This\ device\ is\ not\ bridged"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01556}01556\ \ \ \ \ \ \ Ptr<Node>\ nodeTemp\ =\ ndOther-\/>GetNode\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01557}01557\ \ \ \ \ \ \ NS\_ASSERT\ (nodeTemp);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01558}01558\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01559}01559\ \ \ \ \ \ \ Ptr<DGRRouter>\ rtr\ =\ nodeTemp-\/>GetObject<\mbox{\hyperlink{classns3_1_1_d_g_r_router}{DGRRouter}}>\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01560}01560\ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (rtr)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01561}01561\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01562}01562\ \ \ \ \ \ \ \ \ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}Found\ DGRRouter\ interface,\ return\ true"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01563}01563\ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01564}01564\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01565}01565\ \ \ \ \ \ \ \textcolor{keywordflow}{else}\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01566}01566\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01567}01567\ \ \ \ \ \ \ \ \ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}No\ DGRRouter\ interface\ on\ device,\ continue\ search"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01568}01568\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01569}01569\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01570}01570\ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}No\ routers\ found,\ return\ false"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01571}01571\ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01572}01572\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01573}01573\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01574}01574\ uint32\_t}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01575}\mbox{\hyperlink{classns3_1_1_d_g_r_router_a3021e686d8c500dbecdb4685c6a8e9f1}{01575}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_a3021e686d8c500dbecdb4685c6a8e9f1}{DGRRouter::GetNumLSAs}}\ (\textcolor{keywordtype}{void})\textcolor{keyword}{\ const}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01576}01576\ \textcolor{keyword}{}\{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01577}01577\ \ \ NS\_LOG\_FUNCTION\ (\textcolor{keyword}{this});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01578}01578\ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_aa839f56748d61a63ad55c0db58ddd07f}{m\_LSAs}}.size\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01579}01579\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01580}01580\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01581}01581\ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01582}01582\ \textcolor{comment}{//\ Get\ the\ nth\ link\ state\ advertisement\ from\ this\ router.}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01583}01583\ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01584}01584\ \textcolor{keywordtype}{bool}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01585}\mbox{\hyperlink{classns3_1_1_d_g_r_router_a4ade1b0b9aa88148e3fb7366a29cb01f}{01585}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_a4ade1b0b9aa88148e3fb7366a29cb01f}{DGRRouter::GetLSA}}\ (uint32\_t\ n,\ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a}{DGRRoutingLSA}}\ \&lsa)\textcolor{keyword}{\ const}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01586}01586\ \textcolor{keyword}{}\{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01587}01587\ \ \ NS\_LOG\_FUNCTION\ (\textcolor{keyword}{this}\ <<\ n\ <<\ \&lsa);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01588}01588\ \ \ NS\_ASSERT\_MSG\ (lsa.\mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a_a658f443f5c9022b0e979b70076dd3b16}{IsEmpty}}\ (),\ \textcolor{stringliteral}{"{}DGRRouter::GetLSA\ ():\ Must\ pass\ empty\ LSA"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01589}01589\ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01590}01590\ \textcolor{comment}{//\ All\ of\ the\ work\ was\ done\ in\ GetNumLSAs.\ \ All\ we\ have\ to\ do\ here\ is\ to}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01591}01591\ \textcolor{comment}{//\ walk\ the\ list\ of\ link\ state\ advertisements\ created\ there\ and\ return\ the\ }}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01592}01592\ \textcolor{comment}{//\ one\ the\ client\ is\ interested\ in.}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01593}01593\ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01594}01594\ \ \ ListOfLSAs\_t::const\_iterator\ \mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}}\ =\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_aa839f56748d61a63ad55c0db58ddd07f}{m\_LSAs}}.begin\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01595}01595\ \ \ uint32\_t\ j\ =\ 0;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01596}01596\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01597}01597\ \ \ \textcolor{keywordflow}{for}\ (;\ \mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}}\ !=\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_aa839f56748d61a63ad55c0db58ddd07f}{m\_LSAs}}.end\ ();\ \mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}}++,\ j++)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01598}01598\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01599}01599\ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (j\ ==\ n)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01600}01600\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01601}01601\ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_routing_l_s_a}{DGRRoutingLSA}}\ *p\ =\ *\mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01602}01602\ \ \ \ \ \ \ \ \ \ \ lsa\ =\ *p;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01603}01603\ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01604}01604\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01605}01605\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01606}01606\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01607}01607\ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01608}01608\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01609}01609\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01610}01610\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01611}\mbox{\hyperlink{classns3_1_1_d_g_r_router_a2ee18787000708d7c125fc228b405d43}{01611}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_a2ee18787000708d7c125fc228b405d43}{DGRRouter::InjectRoute}}\ (Ipv4Address\ network,\ Ipv4Mask\ networkMask)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01612}01612\ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01613}01613\ \ \ NS\_LOG\_FUNCTION\ (\textcolor{keyword}{this}\ <<\ network\ <<\ networkMask);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01614}01614\ \ \ \mbox{\hyperlink{classns3_1_1_ipv4_d_g_r_routing_table_entry}{Ipv4DGRRoutingTableEntry}}\ *route\ =\ \textcolor{keyword}{new}\ \mbox{\hyperlink{classns3_1_1_ipv4_d_g_r_routing_table_entry}{Ipv4DGRRoutingTableEntry}}\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01615}01615\ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01616}01616\ \textcolor{comment}{//\ Interface\ number\ does\ not\ matter\ here,\ using\ 1.}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01617}01617\ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01618}01618\ \ \ *route\ =\ \mbox{\hyperlink{classns3_1_1_ipv4_d_g_r_routing_table_entry_ac251919954195223794f62f921d9708b}{Ipv4DGRRoutingTableEntry::CreateNetworkRouteTo}}\ (network,}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01619}01619\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ networkMask,}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01620}01620\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 1);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01621}01621\ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_router_a44d220216aad103c57fbd253f80df2b2}{m\_injectedRoutes}}.push\_back\ (route);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01622}01622\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01623}01623\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01624}01624\ \mbox{\hyperlink{classns3_1_1_ipv4_d_g_r_routing_table_entry}{Ipv4DGRRoutingTableEntry}}\ *}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01625}\mbox{\hyperlink{classns3_1_1_d_g_r_router_aed205a6c27d00eb8a5e3283969809829}{01625}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_aed205a6c27d00eb8a5e3283969809829}{DGRRouter::GetInjectedRoute}}\ (uint32\_t\ index)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01626}01626\ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01627}01627\ \ \ NS\_LOG\_FUNCTION\ (\textcolor{keyword}{this}\ <<\ index);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01628}01628\ \ \ \textcolor{keywordflow}{if}\ (index\ <\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_a44d220216aad103c57fbd253f80df2b2}{m\_injectedRoutes}}.size\ ())}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01629}01629\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01630}01630\ \ \ \ \ \ \ uint32\_t\ tmp\ =\ 0;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01631}01631\ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\mbox{\hyperlink{classns3_1_1_d_g_r_router_a45ba88a691f800f523041ad82ce36f91}{InjectedRoutesCI}}\ \mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}}\ =\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_a44d220216aad103c57fbd253f80df2b2}{m\_injectedRoutes}}.begin\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01632}01632\ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}}\ !=\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_a44d220216aad103c57fbd253f80df2b2}{m\_injectedRoutes}}.end\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01633}01633\ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}}++)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01634}01634\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01635}01635\ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (tmp\ \ ==\ index)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01636}01636\ \ \ \ \ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01637}01637\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ *\mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01638}01638\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01639}01639\ \ \ \ \ \ \ \ \ \ \ tmp++;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01640}01640\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01641}01641\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01642}01642\ \ \ NS\_ASSERT\ (\textcolor{keyword}{false});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01643}01643\ \ \ \textcolor{comment}{//\ quiet\ compiler.}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01644}01644\ \ \ \textcolor{keywordflow}{return}\ 0;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01645}01645\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01646}01646\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01647}01647\ uint32\_t}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01648}\mbox{\hyperlink{classns3_1_1_d_g_r_router_a438d464b3b2402bf8f7cc9e383542ae7}{01648}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_a438d464b3b2402bf8f7cc9e383542ae7}{DGRRouter::GetNInjectedRoutes}}\ ()}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01649}01649\ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01650}01650\ \ \ NS\_LOG\_FUNCTION\ (\textcolor{keyword}{this});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01651}01651\ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_a44d220216aad103c57fbd253f80df2b2}{m\_injectedRoutes}}.size\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01652}01652\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01653}01653\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01654}01654\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01655}\mbox{\hyperlink{classns3_1_1_d_g_r_router_a2a9290440b576b8a32c3a944409cc38f}{01655}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_a2a9290440b576b8a32c3a944409cc38f}{DGRRouter::RemoveInjectedRoute}}\ (uint32\_t\ index)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01656}01656\ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01657}01657\ \ \ NS\_LOG\_FUNCTION\ (\textcolor{keyword}{this}\ <<\ index);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01658}01658\ \ \ NS\_ASSERT\ (index\ <\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_a44d220216aad103c57fbd253f80df2b2}{m\_injectedRoutes}}.size\ ());}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01659}01659\ \ \ uint32\_t\ tmp\ =\ 0;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01660}01660\ \ \ \textcolor{keywordflow}{for}\ (\mbox{\hyperlink{classns3_1_1_d_g_r_router_a225672861cc79568c5c6c231b45951fd}{InjectedRoutesI}}\ \mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}}\ =\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_a44d220216aad103c57fbd253f80df2b2}{m\_injectedRoutes}}.begin\ ();\ \mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}}\ !=\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_a44d220216aad103c57fbd253f80df2b2}{m\_injectedRoutes}}.end\ ();\ \mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}}++)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01661}01661\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01662}01662\ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (tmp\ \ ==\ index)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01663}01663\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01664}01664\ \ \ \ \ \ \ \ \ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}Removing\ route\ "{}}\ <<\ index\ <<\ \textcolor{stringliteral}{"{};\ size\ =\ "{}}\ <<\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_a44d220216aad103c57fbd253f80df2b2}{m\_injectedRoutes}}.size\ ());}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01665}01665\ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{delete}\ *\mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01666}01666\ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_router_a44d220216aad103c57fbd253f80df2b2}{m\_injectedRoutes}}.erase\ (\mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01667}01667\ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01668}01668\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01669}01669\ \ \ \ \ \ \ tmp++;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01670}01670\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01671}01671\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01672}01672\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01673}01673\ \textcolor{keywordtype}{bool}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01674}\mbox{\hyperlink{classns3_1_1_d_g_r_router_af299a2048022a7a4f360e40d4b787eb8}{01674}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_af299a2048022a7a4f360e40d4b787eb8}{DGRRouter::WithdrawRoute}}\ (Ipv4Address\ network,\ Ipv4Mask\ networkMask)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01675}01675\ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01676}01676\ \ \ NS\_LOG\_FUNCTION\ (\textcolor{keyword}{this}\ <<\ network\ <<\ networkMask);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01677}01677\ \ \ \textcolor{keywordflow}{for}\ (\mbox{\hyperlink{classns3_1_1_d_g_r_router_a225672861cc79568c5c6c231b45951fd}{InjectedRoutesI}}\ \mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}}\ =\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_a44d220216aad103c57fbd253f80df2b2}{m\_injectedRoutes}}.begin\ ();\ \mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}}\ !=\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_a44d220216aad103c57fbd253f80df2b2}{m\_injectedRoutes}}.end\ ();\ \mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}}++)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01678}01678\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01679}01679\ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ ((*i)-\/>GetDestNetwork\ ()\ ==\ network\ \&\&\ (*i)-\/>GetDestNetworkMask\ ()\ ==\ networkMask)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01680}01680\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01681}01681\ \ \ \ \ \ \ \ \ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}Withdrawing\ route\ to\ network/mask\ "{}}\ <<\ network\ <<\ \textcolor{stringliteral}{"{}/"{}}\ <<\ networkMask);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01682}01682\ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{delete}\ *\mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01683}01683\ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_router_a44d220216aad103c57fbd253f80df2b2}{m\_injectedRoutes}}.erase\ (\mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01684}01684\ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01685}01685\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01686}01686\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01687}01687\ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01688}01688\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01689}01689\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01690}01690\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01691}01691\ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01692}01692\ \textcolor{comment}{//\ Link\ through\ the\ given\ channel\ and\ find\ the\ net\ device\ that's\ on\ the}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01693}01693\ \textcolor{comment}{//\ other\ end.\ \ This\ only\ makes\ sense\ with\ a\ point-\/to-\/point\ channel.}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01694}01694\ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01695}01695\ Ptr<NetDevice>}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01696}\mbox{\hyperlink{classns3_1_1_d_g_r_router_adc8946ca6068b51f7de5935696047a94}{01696}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_adc8946ca6068b51f7de5935696047a94}{DGRRouter::GetAdjacent}}\ (Ptr<NetDevice>\ nd,\ Ptr<Channel>\ ch)\textcolor{keyword}{\ const}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01697}01697\ \textcolor{keyword}{}\{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01698}01698\ \ \ NS\_LOG\_FUNCTION\ (\textcolor{keyword}{this}\ <<\ nd\ <<\ ch);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01699}01699\ \ \ NS\_ASSERT\_MSG\ (ch-\/>GetNDevices\ ()\ ==\ 2,\ \textcolor{stringliteral}{"{}DGRRouter::GetAdjacent\ ():\ Channel\ with\ other\ than\ two\ devices"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01700}01700\ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01701}01701\ \textcolor{comment}{//\ This\ is\ a\ point\ to\ point\ channel\ with\ two\ endpoints.\ \ Get\ both\ of\ them.}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01702}01702\ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01703}01703\ \ \ Ptr<NetDevice>\ nd1\ =\ ch-\/>GetDevice\ (0);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01704}01704\ \ \ Ptr<NetDevice>\ nd2\ =\ ch-\/>GetDevice\ (1);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01705}01705\ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01706}01706\ \textcolor{comment}{//\ One\ of\ the\ endpoints\ is\ going\ to\ be\ "{}us"{}\ -\/-\/\ that\ is\ the\ net\ device\ attached}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01707}01707\ \textcolor{comment}{//\ to\ the\ node\ on\ which\ we're\ running\ -\/-\/\ i.e.,\ "{}nd"{}.\ \ The\ other\ endpoint\ (the}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01708}01708\ \textcolor{comment}{//\ one\ to\ which\ we\ are\ connected\ via\ the\ channel)\ is\ the\ adjacent\ router.}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01709}01709\ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01710}01710\ \ \ \textcolor{keywordflow}{if}\ (nd1\ ==\ nd)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01711}01711\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01712}01712\ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ nd2;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01713}01713\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01714}01714\ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (nd2\ ==\ nd)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01715}01715\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01716}01716\ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ nd1;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01717}01717\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01718}01718\ \ \ \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01719}01719\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01720}01720\ \ \ \ \ \ \ NS\_ASSERT\_MSG\ (\textcolor{keyword}{false},}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01721}01721\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}DGRRouter::GetAdjacent\ ():\ Wrong\ or\ confused\ channel?"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01722}01722\ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ 0;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01723}01723\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01724}01724\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01725}01725\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01726}01726\ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01727}01727\ \textcolor{comment}{//\ Given\ a\ node\ and\ a\ net\ device,\ find\ an\ IPV4\ interface\ index\ that\ corresponds}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01728}01728\ \textcolor{comment}{//\ to\ that\ net\ device.\ \ This\ function\ may\ fail\ for\ various\ reasons.\ \ If\ a\ node}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01729}01729\ \textcolor{comment}{//\ does\ not\ have\ an\ internet\ stack\ (for\ example\ if\ it\ is\ a\ bridge)\ we\ won't\ have}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01730}01730\ \textcolor{comment}{//\ an\ IPv4\ at\ all.\ \ If\ the\ node\ does\ have\ a\ stack,\ but\ the\ net\ device\ in\ question}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01731}01731\ \textcolor{comment}{//\ is\ bridged,\ there\ will\ not\ be\ an\ interface\ associated\ directly\ with\ the\ device.}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01732}01732\ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01733}01733\ \textcolor{keywordtype}{bool}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01734}\mbox{\hyperlink{classns3_1_1_d_g_r_router_a817add200a30892091534c2d42fa43e5}{01734}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_a817add200a30892091534c2d42fa43e5}{DGRRouter::FindInterfaceForDevice}}\ (Ptr<Node>\ node,\ Ptr<NetDevice>\ nd,\ uint32\_t\ \&index)\textcolor{keyword}{\ const}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01735}01735\ \textcolor{keyword}{}\{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01736}01736\ \ \ NS\_LOG\_FUNCTION\ (\textcolor{keyword}{this}\ <<\ node\ <<\ nd\ <<\ \&index);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01737}01737\ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}For\ node\ "{}}\ <<\ node-\/>GetId\ ()\ <<\ \textcolor{stringliteral}{"{}\ for\ net\ device\ "{}}\ <<\ nd\ );}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01738}01738\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01739}01739\ \ \ Ptr<Ipv4>\ ipv4\ =\ node-\/>GetObject<Ipv4>\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01740}01740\ \ \ \textcolor{keywordflow}{if}\ (!ipv4)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01741}01741\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01742}01742\ \ \ \ \ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}No\ Ipv4\ interface\ on\ node\ "{}}\ <<\ node-\/>GetId\ ());}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01743}01743\ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01744}01744\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01745}01745\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01746}01746\ \ \ \textcolor{keywordflow}{for}\ (uint32\_t\ \mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}}\ =\ 0;\ \mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}}\ <\ ipv4-\/>GetNInterfaces\ ();\ ++\mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}}\ )}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01747}01747\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01748}01748\ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (ipv4-\/>GetNetDevice\ (\mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}})\ ==\ nd)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01749}01749\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01750}01750\ \ \ \ \ \ \ \ \ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}Device\ "{}}\ <<\ nd\ <<\ \textcolor{stringliteral}{"{}\ has\ associated\ ipv4\ index\ "{}}\ <<\ \mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01751}01751\ \ \ \ \ \ \ \ \ \ \ index\ =\ \mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01752}01752\ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01753}01753\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01754}01754\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01755}01755\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01756}01756\ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}Device\ "{}}\ <<\ nd\ <<\ \textcolor{stringliteral}{"{}\ has\ no\ associated\ ipv4\ index"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01757}01757\ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01758}01758\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01759}01759\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01760}01760\ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01761}01761\ \textcolor{comment}{//\ Decide\ whether\ or\ not\ a\ given\ net\ device\ is\ being\ bridged\ by\ a\ BridgeNetDevice.}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01762}01762\ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01763}01763\ Ptr<BridgeNetDevice>}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01764}\mbox{\hyperlink{classns3_1_1_d_g_r_router_a53fdf9c96432439b34d091da6050890b}{01764}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_a53fdf9c96432439b34d091da6050890b}{DGRRouter::NetDeviceIsBridged}}\ (Ptr<NetDevice>\ nd)\textcolor{keyword}{\ const}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01765}01765\ \textcolor{keyword}{}\{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01766}01766\ \ \ NS\_LOG\_FUNCTION\ (\textcolor{keyword}{this}\ <<\ nd);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01767}01767\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01768}01768\ \ \ Ptr<Node>\ node\ =\ nd-\/>GetNode\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01769}01769\ \ \ uint32\_t\ nDevices\ =\ node-\/>GetNDevices\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01770}01770\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01771}01771\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01772}01772\ \ \ \textcolor{comment}{//\ There\ is\ no\ bit\ on\ a\ net\ device\ that\ says\ it\ is\ being\ bridged,\ so\ we\ have}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01773}01773\ \ \ \textcolor{comment}{//\ to\ look\ for\ bridges\ on\ the\ node\ to\ which\ the\ device\ is\ attached.\ \ If\ we}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01774}01774\ \ \ \textcolor{comment}{//\ find\ a\ bridge,\ we\ need\ to\ look\ through\ its\ bridge\ ports\ (the\ devices\ it}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01775}01775\ \ \ \textcolor{comment}{//\ bridges)\ to\ see\ if\ we\ find\ the\ device\ in\ question.}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01776}01776\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01777}01777\ \ \ \textcolor{keywordflow}{for}\ (uint32\_t\ \mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}}\ =\ 0;\ \mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}}\ <\ nDevices;\ ++\mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}})}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01778}01778\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01779}01779\ \ \ \ \ \ \ Ptr<NetDevice>\ ndTest\ =\ node-\/>GetDevice\ (\mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01780}01780\ \ \ \ \ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}Examine\ device\ "{}}\ <<\ \mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}}\ <<\ \textcolor{stringliteral}{"{}\ "{}}\ <<\ ndTest);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01781}01781\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01782}01782\ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (ndTest-\/>IsBridge\ ())}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01783}01783\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01784}01784\ \ \ \ \ \ \ \ \ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}device\ "{}}\ <<\ \mbox{\hyperlink{namespacens3_aa5e169e2453984d2f21c0d5cec9e907b}{i}}\ <<\ \textcolor{stringliteral}{"{}\ is\ a\ bridge\ net\ device"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01785}01785\ \ \ \ \ \ \ \ \ \ \ Ptr<BridgeNetDevice>\ bnd\ =\ ndTest-\/>GetObject<BridgeNetDevice>\ ();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01786}01786\ \ \ \ \ \ \ \ \ \ \ NS\_ABORT\_MSG\_UNLESS\ (bnd,\ \textcolor{stringliteral}{"{}DGRRouter::DiscoverLSAs\ ():\ GetObject\ for\ <BridgeNetDevice>\ failed"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01787}01787\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01788}01788\ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (uint32\_t\ j\ =\ 0;\ j\ <\ bnd-\/>GetNBridgePorts\ ();\ ++j)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01789}01789\ \ \ \ \ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01790}01790\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}Examine\ bridge\ port\ "{}}\ <<\ j\ <<\ \textcolor{stringliteral}{"{}\ "{}}\ <<\ bnd-\/>GetBridgePort\ (j));}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01791}01791\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (bnd-\/>GetBridgePort\ (j)\ ==\ nd)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01792}01792\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01793}01793\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}Net\ device\ "{}}\ <<\ nd\ <<\ \textcolor{stringliteral}{"{}\ is\ bridged\ by\ "{}}\ <<\ bnd);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01794}01794\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ bnd;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01795}01795\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01796}01796\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01797}01797\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01798}01798\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01799}01799\ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}Net\ device\ "{}}\ <<\ nd\ <<\ \textcolor{stringliteral}{"{}\ is\ not\ bridged"{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01800}01800\ \ \ \textcolor{keywordflow}{return}\ 0;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01801}01801\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01802}01802\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01803}01803\ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01804}01804\ \textcolor{comment}{//\ Start\ a\ new\ enumeration\ of\ an\ L2\ broadcast\ domain\ by\ clearing\ m\_bridgesVisited}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01805}01805\ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01806}01806\ \textcolor{keywordtype}{void}\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01807}\mbox{\hyperlink{classns3_1_1_d_g_r_router_a9c480fca2799ed5e445820561087500e}{01807}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_a9c480fca2799ed5e445820561087500e}{DGRRouter::ClearBridgesVisited}}\ (\textcolor{keywordtype}{void})\textcolor{keyword}{\ const}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01808}01808\ \textcolor{keyword}{}\{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01809}01809\ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_router_a3a387b1e294fec2c8ab1e3b81e1a3a47}{m\_bridgesVisited}}.clear();}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01810}01810\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01811}01811\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01812}01812\ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01813}01813\ \textcolor{comment}{//\ Check\ if\ we\ have\ already\ visited\ a\ given\ bridge\ net\ device\ by\ searching\ m\_bridgesVisited}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01814}01814\ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01815}01815\ \textcolor{keywordtype}{bool}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01816}\mbox{\hyperlink{classns3_1_1_d_g_r_router_a12f7423d137d6716fc597ee947173c41}{01816}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_a12f7423d137d6716fc597ee947173c41}{DGRRouter::BridgeHasAlreadyBeenVisited}}\ (Ptr<BridgeNetDevice>\ bridgeNetDevice)\textcolor{keyword}{\ const}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01817}01817\ \textcolor{keyword}{}\{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01818}01818\ \ \ std::vector<Ptr<BridgeNetDevice>\ >::iterator\ iter;}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01819}01819\ \ \ \textcolor{keywordflow}{for}\ (iter\ =\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_a3a387b1e294fec2c8ab1e3b81e1a3a47}{m\_bridgesVisited}}.begin\ ();\ iter\ !=\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_a3a387b1e294fec2c8ab1e3b81e1a3a47}{m\_bridgesVisited}}.end\ ();\ ++iter)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01820}01820\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01821}01821\ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (bridgeNetDevice\ ==\ *iter)}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01822}01822\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01823}01823\ \ \ \ \ \ \ \ \ \ \ NS\_LOG\_LOGIC\ (\textcolor{stringliteral}{"{}Bridge\ "{}}\ <<\ bridgeNetDevice\ <<\ \textcolor{stringliteral}{"{}\ has\ been\ visited."{}});}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01824}01824\ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01825}01825\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01826}01826\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01827}01827\ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01828}01828\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01829}01829\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01830}01830\ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01831}01831\ \textcolor{comment}{//\ Remember\ that\ we\ visited\ a\ bridge\ net\ device\ by\ adding\ it\ to\ m\_bridgesVisited}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01832}01832\ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01833}01833\ \textcolor{keywordtype}{void}\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01834}\mbox{\hyperlink{classns3_1_1_d_g_r_router_ac62c957b71fbe4ce12586c380dbfceeb}{01834}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_router_ac62c957b71fbe4ce12586c380dbfceeb}{DGRRouter::MarkBridgeAsVisited}}\ (Ptr<BridgeNetDevice>\ bridgeNetDevice)\textcolor{keyword}{\ const}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01835}01835\ \textcolor{keyword}{}\{}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01836}01836\ \ \ NS\_LOG\_FUNCTION\ (\textcolor{keyword}{this}\ <<\ bridgeNetDevice);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01837}01837\ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_router_a3a387b1e294fec2c8ab1e3b81e1a3a47}{m\_bridgesVisited}}.push\_back\ (bridgeNetDevice);}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01838}01838\ \}}
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01839}01839\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01840}01840\ }
\DoxyCodeLine{\Hypertarget{dgr-router-interface_8cc_source_l01841}01841\ \}\ \textcolor{comment}{//\ namespace\ ns3}}

\end{DoxyCode}
